mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-29 05:56:30 +02:00
lint, clean up tests, clean up user displays in admin (remove is_staff and is_superuser and replace with group)
This commit is contained in:
parent
8db5219986
commit
11c0186b09
2 changed files with 12 additions and 13 deletions
|
@ -138,8 +138,8 @@ class MyUserAdmin(BaseUserAdmin):
|
|||
"first_group",
|
||||
"status",
|
||||
)
|
||||
|
||||
# First group (which should by theory be the only group)
|
||||
|
||||
# First group (which should in theory be the ONLY group)
|
||||
def first_group(self, obj):
|
||||
return f"{obj.groups.first()}"
|
||||
|
||||
|
@ -195,8 +195,6 @@ class MyUserAdmin(BaseUserAdmin):
|
|||
"email",
|
||||
"Permissions",
|
||||
"is_active",
|
||||
"is_staff",
|
||||
"is_superuser",
|
||||
"groups",
|
||||
"Important dates",
|
||||
"last_login",
|
||||
|
@ -217,8 +215,7 @@ class MyUserAdmin(BaseUserAdmin):
|
|||
"email",
|
||||
"first_name",
|
||||
"last_name",
|
||||
"is_staff",
|
||||
"is_superuser",
|
||||
"first_group",
|
||||
"status",
|
||||
)
|
||||
|
||||
|
@ -840,7 +837,9 @@ class DomainAdmin(ListHeaderAdmin):
|
|||
# Fixes a bug wherein users which are only is_staff
|
||||
# can access 'change' when GET,
|
||||
# but cannot access this page when it is a request of type POST.
|
||||
if request.user.is_staff:
|
||||
if request.user.has_perm(
|
||||
"registrar.full_access_permission"
|
||||
) or request.user.has_perm("registrar.analyst_access_permission"):
|
||||
return True
|
||||
return super().has_change_permission(request, obj)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue