mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-22 23:17:09 +00:00
add handler on user not found exception
This commit is contained in:
@@ -19,7 +19,10 @@ class BearerAuth(HttpBearer):
|
||||
except Exception:
|
||||
raise AuthenticationError
|
||||
|
||||
user = User.objects.get(id=data["id"])
|
||||
try:
|
||||
user = User.objects.get(id=data["id"])
|
||||
except User.DoesNotExist:
|
||||
raise AuthenticationError
|
||||
return user
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user