Skip to content

Commit

Permalink
Merge pull request #2362 from onaio/2361-authentication-read-replica
Browse files Browse the repository at this point in the history
Ensure that the `user` row is selected alongside the `Token`
  • Loading branch information
KipSigei authored Feb 1, 2023
2 parents 3728dbb + 764f28d commit 17fbda6
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 17fbda6

Please sign in to comment.