AttributeError: 'NoneType' object has no attribute 'is_superuser' #8142
Unanswered
dalmia
asked this question in
Potential Issue
Replies: 1 comment
-
|
Might be missing or failing to run the middleware to populate |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone,
Thank you so much for the amazing work done by all the contributors. I am very grateful for your work.
We've been using DRF for managing our APIs and while everything seems to be working fine on production, we are constantly seeing this error in the production logs:
A bit about the structure of the app:
We have a model for users (
User), organizations (Organization) and organization users (OrganizationUser). TheUsermodel contains a field calledorganizationswhich gets auto-populated based on the entries in theOrganizationUsertable (many-to-many relationship).The line mentioned above in the logs appears in the
OrganizationUserViewSetas shown below:You can even check out the complete code here.
No other part of the codebase is supposed to be invoking the
OrganizationUserViewsetapart from the many-to-many relationship mapping in theUsermodel mentioned above.What do you think could be causing the
request.userobject to be returned asNone?Beta Was this translation helpful? Give feedback.
All reactions