I have create a custom user model for my django apps. Now i want to use the django permissions and groups system. I made permission and groups but when i go to use them in my custom user model a take errors like
>>> john.groups.add(special_users)
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: 'MyCustomUserModel' object has no attribute 'groups'
I imagine that i have to put some extra code in my custom user model to integrate this functionality Could anyone help with this problem?
Finally MyCustomUserModel had to inherit and from PermissionsMixin
class MyCustomUserModel(AbstractBaseUser,PermissionsMixin):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With