We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d9b8f3f commit f3151adCopy full SHA for f3151ad
rest_auth/views.py
@@ -1,5 +1,6 @@
1
from django.contrib.auth import login, logout
2
from django.conf import settings
3
+from django.core.exceptions import ObjectDoesNotExist
4
5
from rest_framework import status
6
from rest_framework.views import APIView
@@ -64,7 +65,7 @@ class LogoutView(APIView):
64
65
def post(self, request):
66
try:
67
request.user.auth_token.delete()
- except:
68
+ except (AttributeError, ObjectDoesNotExist):
69
pass
70
71
logout(request)
0 commit comments