14👍
✅
There is a typo in your admin class as you are not overriding the default list_display
option which contains first_name
. It should be list_display
instead of List_display
inside UserAdmin
:
class UserAdmin(BaseUserAdmin):
add_form = UserCreationForm
list_display = ('username', 'email', 'is_admin')
list_filter = ('is_admin',)
fieldsets = (
(None, {'fields': ('username', 'email','password')}),
('Permissions', {'fields': ('is_admin',)}),
)
search_fields = ('username', 'email')
ordering = ('username','email')
filter_horizontal = ()
admin.site.register(MyUser,UserAdmin)
Source:stackexchange.com