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.shortcuts import redirect
|
||||||
from django.views.decorators.http import require_POST
|
from django.views.decorators.http import require_POST
|
||||||
|
|
||||||
|
|
||||||
@require_POST
|
@require_POST
|
||||||
def logout_view(request):
|
def logout(request):
|
||||||
"""The view to log out a user.
|
"""The view to log out a user.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -13,7 +13,7 @@ def logout_view(request):
|
|||||||
Returns:
|
Returns:
|
||||||
HttpRedirectResponse: The redirect response.
|
HttpRedirectResponse: The redirect response.
|
||||||
"""
|
"""
|
||||||
logout(request)
|
logout_user(request)
|
||||||
if "next" in request.POST:
|
if "next" in request.POST:
|
||||||
request.session["logout"] = True
|
request.session["logout"] = True
|
||||||
return redirect(request.POST["next"])
|
return redirect(request.POST["next"])
|
||||||
|
Loading…
Reference in New Issue
Block a user