-
Notifications
You must be signed in to change notification settings - Fork 769
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
Do not access the internals of SimpleLazyObject
#945
Conversation
For context, see also Django source code, which implies |
@jkimbo any thoughts on this? It's a fairly small change and tests pass. |
@pcraciunoiu sorry for the delay. Could you add a test to this PR to show the changes working? |
Here you go. Before the changes, the test results in:
I tried setting up the middleware to do it, but there's no pattern of tests that use Django's middleware yet, so I hope this will suffice. Lazy should be allowed to work when they're chained and now that part's tested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thanks!
Thank you too @jkimbo can you say if this will make it into graphene-django 2 as well as 3? Ah looks like I just missed today's release :/ hope there will be one in the next couple of weeks. |
@pcraciunoiu yep I'll release this as part of v2.10.1 soon. I was just going to wait a couple of days to see if there are any issues that come up as a result of the v2.10.0 release. |
@jkimbo thoughts on a release with the fix this week? |
@pcraciunoiu sorry for the delay. Just released v2.10.1 with your fix: https://github.com/graphql-python/graphene-django/releases/tag/v2.10.1 |
This API is not meant to be used, and it breaks when double-wrapped lazy objects occur, which appears to be a long standing practice.
See original issue in django-otp django-otp/django-otp#36
This was introduced a long time ago, in v1.1.0, surprised it hasn't come up before?
d73f4aa
At any rate, if you have both
AuthenticationMiddleware
and Django OTP, this will blow up with: