cleanup some code

This commit is contained in:
Rachid Mrad 2023-10-03 18:54:55 -04:00
parent 08514a75dc
commit 09303401ed
No known key found for this signature in database
GPG key ID: EF38E4CEC4A8F3CF
3 changed files with 12 additions and 8 deletions

View file

@ -192,6 +192,14 @@ class MyUserAdmin(BaseUserAdmin):
),
("Important dates", {"fields": ("last_login", "date_joined")}),
)
analyst_list_display = [
"email",
"first_name",
"last_name",
"group",
"status",
]
# NOT all fields are readonly for admin, otherwise we would have
# set this at the permissions level. The exception is 'status'
@ -219,13 +227,7 @@ class MyUserAdmin(BaseUserAdmin):
return super().get_list_display(request)
# Customize the list display for analysts
return (
"email",
"first_name",
"last_name",
"group",
"status",
)
return self.analyst_list_display
def get_fieldsets(self, request, obj=None):
if request.user.has_perm("registrar.full_access_permission"):