I want to add add inline model and exclude some fields from User change form in Django admin.
I'm trying to override Django's built-in UserAdmin
to preserve User change design:
class UserCustomAdmin(UserAdmin):
# list_display = ['id', 'username','email', 'last_login']
exclude = ['groups','user_permissions']
inlines = [UserProfileInline]
Even exclude = ['groups']
raises error:
u"Key 'groups' not found in 'UserForm'. Choices are: date_joined, email, first_name, is_active, is_staff, is_superuser, last_login, last_name, password, username."
How to make it work?