Skip to content

Commit

Permalink
Ensure user entry is retrieved alongside the Token
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisRayM committed Feb 1, 2023
1 parent 3728dbb commit 764f28d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion onadata/libs/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def authenticate_credentials(self, key):
try:
if isinstance(key, bytes):
key = key.decode("utf-8")
token = self.model.objects.get(key=key)
token = self.model.objects.select_related("user").get(key=key)
except self.model.DoesNotExist as e:
invalid_token = True
if getattr(settings, "SLAVE_DATABASES", []):
Expand Down

0 comments on commit 764f28d

Please sign in to comment.