mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-02-11 15:30:34 +03:00
Fixed try/catch in logout view
This commit is contained in:
parent
d9b8f3faf6
commit
f3151ad5c0
|
@ -1,5 +1,6 @@
|
|||
from django.contrib.auth import login, logout
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
|
||||
from rest_framework import status
|
||||
from rest_framework.views import APIView
|
||||
|
@ -64,7 +65,7 @@ class LogoutView(APIView):
|
|||
def post(self, request):
|
||||
try:
|
||||
request.user.auth_token.delete()
|
||||
except:
|
||||
except (AttributeError, ObjectDoesNotExist):
|
||||
pass
|
||||
|
||||
logout(request)
|
||||
|
|
Loading…
Reference in New Issue
Block a user