I wrote a custom admin class for Users in the Django Admin as follows:
class UserAdmin(admin.ModelAdmin):
model = User
list_display = ['email', 'first_name', 'last_name', 'last_login', 'date_joined', 'is_superuser', 'is_active']
list_filter = ['is_active', 'groups']
search_fields = ['email', 'first_name', 'last_name']
admin.site.unregister(User)
admin.site.register(User, UserAdmin)
This breaks the ‘change password’ feature in the Django Admin. What do I have to add to my custom class to allow it to work again?
Thanks.
You need to inherit from
django.contrib.auth.admin.UserAdmin, rather thanadmin.ModelAdmin