From dafca0fee8ac618ee9aab5ce8a1d7c34aafc3a05 Mon Sep 17 00:00:00 2001 From: scragly <29337040+scragly@users.noreply.github.com> Date: Sun, 20 Sep 2020 02:06:11 +1000 Subject: Change UserTopRoleFilter to UserRoleFilter. Filter checks for general role membership instead of only those who have the selected role as top role. Noticed during development that we'd not be able to filter to show all Helpers otherwise, as some Helpers have different top roles such as Core Dev that wouldn't give immediately obvious behaviour to user expectations. --- pydis_site/apps/api/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pydis_site/apps/api') diff --git a/pydis_site/apps/api/admin.py b/pydis_site/apps/api/admin.py index 6267b7a8..733a056d 100644 --- a/pydis_site/apps/api/admin.py +++ b/pydis_site/apps/api/admin.py @@ -380,7 +380,7 @@ class RoleAdmin(admin.ModelAdmin): return False -class UserTopRoleFilter(admin.SimpleListFilter): +class UserRoleFilter(admin.SimpleListFilter): """List Filter for User list Admin page.""" title = "Role" @@ -426,7 +426,7 @@ class UserAdmin(admin.ModelAdmin): all_roles_coloured.short_description = "All Roles" search_fields = ("name", "id", "roles") - list_filter = (UserTopRoleFilter, "in_guild") + list_filter = (UserRoleFilter, "in_guild") list_display = ("username", "top_role_coloured", "in_guild") fields = ("username", "id", "in_guild", "all_roles_coloured") sortable_by = ("username",) -- cgit v1.2.3