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

New authentication backend to eliminate queries #332

Closed
jonathan-s opened this issue Jun 4, 2020 · 0 comments · Fixed by #351
Closed

New authentication backend to eliminate queries #332

jonathan-s opened this issue Jun 4, 2020 · 0 comments · Fixed by #351

Comments

@jonathan-s
Copy link
Contributor

jonathan-s commented Jun 4, 2020

The standard ModelBackend makes a request to get the user. We also have a context_processor that makes a query to get the account of that user.

It would be better to provide a model backend that fetches the user and also selects the account at the same time. That would happen here.

In the context processor we could then refer to request.user.account.

This would eliminate one roundtrip to the database.

Note: I'd be happy to contribute a PR for this. Let me know if it is wished for. Right now it looks like the maintainers are busy with other things, it's always a bit of a letdown when your PR lingers for a long time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant