Skip to content

Commit

Permalink
feat: add ability to search fields and filter fields in Account admin…
Browse files Browse the repository at this point in the history
… view (#91)

* feat: reorder fields in list view and add adminship boolean field to User

* feat: add filter fields and search fields to Account admin view
  • Loading branch information
corp-0 authored Mar 16, 2024
1 parent d98b6e7 commit e206f08
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/accounts/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ def is_token_valid_display(self, instance):
@admin.register(Account)
class AccountAdminView(admin.ModelAdmin):
list_display = (
"email",
"is_active",
"unique_identifier",
"email",
"username",
"is_confirmed",
"is_verified",
"is_active",
"is_staff",
"legacy_id",
)
fieldsets = (
Expand All @@ -57,9 +58,16 @@ class AccountAdminView(admin.ModelAdmin):
"is_active",
"is_confirmed",
"is_verified",
"is_staff",
),
},
),
("Legacy", {"classes": ("wide",), "fields": ("legacy_id",)}),
)
inlines = [AccountConfirmationInline, PasswordResetRequestInline]
list_filter = ("is_staff", "is_verified", "is_confirmed", "is_active")
search_fields = (
"email__icontains",
"username__icontains",
"unique_identifier__icontains",
)

0 comments on commit e206f08

Please sign in to comment.