feat(admin): improve user admin list view and detail page
Add is_superuser to list_display and list_filter. Add is_active, is_staff, is_superuser, last_login (readonly), and user_permissions to the user detail fieldset. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+8
-2
@@ -47,9 +47,9 @@ class SetPinForm(forms.Form):
|
||||
|
||||
@admin.register(User)
|
||||
class CustomUserAdmin(UserAdmin):
|
||||
list_display = ("username", "is_staff", "consumed_drinks_price", "paid_amount", "open_balance")
|
||||
list_display = ("username", "is_staff", "is_superuser", "consumed_drinks_price", "paid_amount", "open_balance")
|
||||
ordering = ("username",)
|
||||
list_filter = ["is_staff"]
|
||||
list_filter = ["is_staff", "is_superuser"]
|
||||
fieldsets = (
|
||||
(
|
||||
None,
|
||||
@@ -58,6 +58,11 @@ class CustomUserAdmin(UserAdmin):
|
||||
"username",
|
||||
"password",
|
||||
"pin_status",
|
||||
"is_active",
|
||||
"is_staff",
|
||||
"is_superuser",
|
||||
"last_login",
|
||||
"user_permissions",
|
||||
)
|
||||
},
|
||||
),
|
||||
@@ -79,6 +84,7 @@ class CustomUserAdmin(UserAdmin):
|
||||
"paid_amount",
|
||||
"open_balance",
|
||||
"pin_status",
|
||||
"last_login",
|
||||
"drinks_breakdown",
|
||||
"free_drinks_breakdown",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user