Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that the user row is selected alongside the Token #2362

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

DavisRayM
Copy link
Contributor

@DavisRayM DavisRayM commented Jan 31, 2023

Changes / Features implemented

  • Ensure that the user row is selected alongside the token

Closes #2361

FrankApiyo
FrankApiyo previously approved these changes Jan 31, 2023
KipSigei
KipSigei previously approved these changes Jan 31, 2023
@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavisRayM could we pin it to the master DB?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest we don't; In the except part of this we retrieve from master if we fail to retrieve from the read replica which I feel is a bit better

@DavisRayM DavisRayM dismissed stale reviews from KipSigei and FrankApiyo via 764f28d February 1, 2023 07:11
@DavisRayM DavisRayM force-pushed the 2361-authentication-read-replica branch from 84a1ee7 to 764f28d Compare February 1, 2023 07:11
@KipSigei KipSigei merged commit 17fbda6 into main Feb 1, 2023
@KipSigei KipSigei deleted the 2361-authentication-read-replica branch February 1, 2023 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User.DoesNotExist: User matching query does not exist.
3 participants