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

move calls to get_settings outside of __init__ #496

Closed
wants to merge 1 commit into from
Closed

move calls to get_settings outside of __init__ #496

wants to merge 1 commit into from

Conversation

phijma-leukeleu
Copy link

@phijma-leukeleu phijma-leukeleu commented Jun 22, 2023

View, middleware and auth backend

Fixes #495

mozilla_django_oidc/middleware.py Outdated Show resolved Hide resolved
mozilla_django_oidc/middleware.py Outdated Show resolved Hide resolved
mozilla_django_oidc/views.py Outdated Show resolved Hide resolved
Comment on lines +50 to +52
@cached_property
def settings(self):
retval = {

Choose a reason for hiding this comment

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

@stevenbal is this going to break our library?

Copy link

@stevenbal stevenbal Feb 6, 2024

Choose a reason for hiding this comment

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

With the way our library is implemented now: yes, because we rely on overriding get_settings

Choose a reason for hiding this comment

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

I don't think this is too much of a problem? I don't see any changes to that method in particular and instead it will allow us to remove our __init__ override since settings are now consumed lazily. So, what am I missing? 😄

Choose a reason for hiding this comment

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

Whoops, I skimmed over it too quickly and thought get_settings was removed here altogether 😅. You're right, this should work and the init override can be removed.

@phijma-leukeleu phijma-leukeleu closed this by deleting the head repository Sep 19, 2024
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.

Don't call get_settings inside __init__
4 participants