I\'ve got a custome user model that extends/inherits AbstractUser. I also want the user creation form in admin to match, but for some reason I can only get it to show Usern
UserAdmin from django.contrib.auth.admin also sets the "add_fieldsets" attribute, that sets the fields to be shown on the add user view. Since UserAdmin sets this field you need to overwrite it to set your own fields.
Here is an example:
class CustomUserAdmin(UserAdmin):
# ...code here...
fieldsets = (
(None, {'fields': ('email',)}),
(_('Personal info'), {'fields': ('first_name', 'last_name')}),
(_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',
'groups', 'user_permissions')}),
(_('Important dates'), {'fields': ('last_login', 'date_joined')}),
)
add_fieldsets = (
(None, {
'classes': ('wide',),
'fields': ('email', 'first_name', 'last_name', 'password1',
'password2')}
),
)
Hope this helps!