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
When opening he django admin, we get the error Cannot query "AnonymousUser": Must be "Group" instance.
A little bit of googling gives me the impression that .has_perm() function invokes the Group class directly and does not update itself to reflect the custom group classes defined in the user model
Ideal Solution
Django guardian should detect the Group model associated with the user model and use it for perms. Or mention a workaround in the docs
The text was updated successfully, but these errors were encountered:
VaZark
changed the title
Broken when Custom groups in AbstractBaseuse!r
Broken when Custom groups in AbstractBaseUser
Aug 12, 2022
Setup
The django project uses an AbstractBaseUser along with a Custom group for permissions.
Error / Unexpected Behaviour
When opening he django admin, we get the error
Cannot query "AnonymousUser": Must be "Group" instance.
A little bit of googling gives me the impression that
.has_perm()
function invokes the Group class directly and does not update itself to reflect the custom group classes defined in the user modelIdeal Solution
Django guardian should detect the
Group
model associated with the user model and use it for perms. Or mention a workaround in the docsThe text was updated successfully, but these errors were encountered: