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

Don't call get_settings inside __init__ #495

Open
phijma-leukeleu opened this issue Jun 21, 2023 · 0 comments
Open

Don't call get_settings inside __init__ #495

phijma-leukeleu opened this issue Jun 21, 2023 · 0 comments

Comments

@phijma-leukeleu
Copy link

phijma-leukeleu commented Jun 21, 2023

Proposal

Move calls to get_settings outside of __init__ of the auth backend, the middleware and the authentication request view.

Why?

Because if you want to overwrite get_settings, to for example use some session data (and therefore the request object), it's impossible now. The request is not known inside the __init__ (of views, middleware and auth backends) yet. You have to do some hacks to get it working. (overwriting the __init__..)

(I ran into this when I tried to support multiple providers, where the chosen provider is in the session)

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 a pull request may close this issue.

1 participant