mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-10 19:26:35 +03:00
disable django_logout if REST_SESSION_LOGIN is False
This commit is contained in:
parent
479a40d2cc
commit
a3d38f4c59
|
@ -121,8 +121,8 @@ class LogoutView(APIView):
|
|||
request.user.auth_token.delete()
|
||||
except (AttributeError, ObjectDoesNotExist):
|
||||
pass
|
||||
|
||||
django_logout(request)
|
||||
if getattr(settings, 'REST_SESSION_LOGIN', True):
|
||||
django_logout(request)
|
||||
|
||||
return Response({"detail": _("Successfully logged out.")},
|
||||
status=status.HTTP_200_OK)
|
||||
|
|
Loading…
Reference in New Issue
Block a user