Update admin to ignore *_name User attributes
Fixes
@@ -12,8 +12,22 @@ class UserAdmin(auth_admin.UserAdmin):
form = UserChangeForm
add_form = UserCreationForm
- fieldsets = (("User", {"fields": ("name",)}),) + tuple(
- auth_admin.UserAdmin.fieldsets
+ fieldsets = (
+ (None, {"fields": ("username", "password")}),
+ (_("Personal info"), {"fields": ("name", "email")}),
+ (
+ _("Permissions"),
+ {
+ "fields": (
+ "is_active",
+ "is_staff",
+ "is_superuser",
+ "groups",
+ "user_permissions",
+ ),
+ },
+ ),
+ (_("Important dates"), {"fields": ("last_login", "date_joined")}),
)
list_display = ["username", "name", "is_superuser"]
search_fields = ["name"]
