mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-07-22 13:39:45 +03:00
It is admitted as bad style to catch any exception: in that case you can not say what is the reason of crash when it happens. Also there is no need to check for exception here, if you just want to cut off anonymous users
This commit is contained in:
parent
456b6b34de
commit
632db51501
|
@ -68,10 +68,8 @@ class LogoutView(APIView):
|
||||||
permission_classes = (AllowAny,)
|
permission_classes = (AllowAny,)
|
||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
try:
|
if not request.user.is_anonymous():
|
||||||
request.user.auth_token.delete()
|
request.user.auth_token.delete()
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
logout(request)
|
logout(request)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user