Django admin should use "_default_manager" not "objects" on csutom auth model class.
|Reported by:||anonymous||Owned by:||nobody|
|Severity:||Release blocker||Keywords:||auth, objects|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I created custom users model "MyUser" and set it as auth model in settings file.
class MyUser(MyAbstractBaseModel, AbstractBaseUser, PermissionsMixin):
my_objects = UserManager()
After login to Admin Panel I've got an error: "type object 'MyUser' has no attribute 'objects'"
Moreover "_default_manager" is pointing to "UserManager" in MyAbstractBaseModel. So, in my opinion Admin Panel should use _default_manager, not "objects".
Change History (9)
comment:1 Changed 2 years ago by kmtracey
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Severity changed from Normal to Release blocker
- Triage Stage changed from Unreviewed to Accepted
- Type changed from Uncategorized to Bug
Changed 2 years ago by apollo13
comment:6 Changed 2 years ago by Florian Apolloner <florian@…>
- Resolution set to fixed
- Status changed from new to closed