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
I have an admin user, if I view the information in the admin panel, the user is really superuser and staff, but if I look for the user's information in the request object, is_superuser and is_staff are False. I really need the superuser information taken from the request, cause I'm filtering data by user:
The solution that I found, was getting the user's pk from request and then get the user from the User model:
user=User.objects.get(id=request.user.pk)
And with that user I can implement what I want.
But I don't know if that is efficient because I think that the library is getting the request.user info from database and then I consult to the db again.
My DRF settings are:
I have an admin user, if I view the information in the admin panel, the user is really superuser and staff, but if I look for the user's information in the
request
object,is_superuser
andis_staff
are False. I really need the superuser information taken from the request, cause I'm filtering data by user:Django filter set:
I'm using the version 5.3.1 of simplejwt.
The text was updated successfully, but these errors were encountered: