Renamed the logout_view() function to logout().
This commit is contained in:
parent
68be53e212
commit
66f1e4b4fa
@ -1,10 +1,10 @@
|
||||
from django.contrib.auth import logout
|
||||
from django.contrib.auth import logout as logout_user
|
||||
from django.shortcuts import redirect
|
||||
from django.views.decorators.http import require_POST
|
||||
|
||||
|
||||
@require_POST
|
||||
def logout_view(request):
|
||||
def logout(request):
|
||||
"""The view to log out a user.
|
||||
|
||||
Args:
|
||||
@ -13,7 +13,7 @@ def logout_view(request):
|
||||
Returns:
|
||||
HttpRedirectResponse: The redirect response.
|
||||
"""
|
||||
logout(request)
|
||||
logout_user(request)
|
||||
if "next" in request.POST:
|
||||
request.session["logout"] = True
|
||||
return redirect(request.POST["next"])
|
||||
|
Loading…
Reference in New Issue
Block a user