You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: