Issue
When editing user model through admin interface, here's what I see: And here's what I expect to see: The second one allows me to modify the user permissions, the first one does not.
The User model I use on the first screenshot inherits from AbstractUser
and is registered in the following way:
from django.contrib import admin
import accounts.models
admin.site.register(accounts.models.User)
In my settings:
DEBUG = True
AUTH_USER_MODEL = 'accounts.User'
What can be the problem? How do I get from the first screenshot to the second?
Solution
OK, the actual problem was that I inherited not from AbstractUser
but from AbstractBaseUser
and forgot about PermissionsMixin
(the mixin adds the apropriate fields). So I should've done something like this.
Answered By - Pavel Vergeev
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.