Merge pull request #506 from Jasper0819X/master

disable django_logout if REST_SESSION_LOGIN is False
This commit is contained in:
mario 2019-02-03 19:02:25 +01:00 committed by GitHub
commit c7cc41e07c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)