mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 09:37:03 +02:00
Clean up group display string
This commit is contained in:
parent
ee11c100a2
commit
b4506d0157
2 changed files with 11 additions and 6 deletions
|
@ -135,13 +135,18 @@ class MyUserAdmin(BaseUserAdmin):
|
||||||
"email",
|
"email",
|
||||||
"first_name",
|
"first_name",
|
||||||
"last_name",
|
"last_name",
|
||||||
"first_group",
|
"group",
|
||||||
"status",
|
"status",
|
||||||
)
|
)
|
||||||
|
|
||||||
# First group (which should in theory be the ONLY group)
|
# Let's define First group
|
||||||
def first_group(self, obj):
|
# (which should in theory be the ONLY group)
|
||||||
return f"{obj.groups.first()}"
|
def group(self, obj):
|
||||||
|
if f"{obj.groups.first()}" == "full_access_group":
|
||||||
|
return "Super User"
|
||||||
|
elif f"{obj.groups.first()}" == "cisa_analysts_group":
|
||||||
|
return "Analyst"
|
||||||
|
return ""
|
||||||
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
(
|
(
|
||||||
|
@ -215,7 +220,7 @@ class MyUserAdmin(BaseUserAdmin):
|
||||||
"email",
|
"email",
|
||||||
"first_name",
|
"first_name",
|
||||||
"last_name",
|
"last_name",
|
||||||
"first_group",
|
"group",
|
||||||
"status",
|
"status",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -786,7 +786,7 @@ class MyUserAdminTest(TestCase):
|
||||||
"email",
|
"email",
|
||||||
"first_name",
|
"first_name",
|
||||||
"last_name",
|
"last_name",
|
||||||
"first_group",
|
"group",
|
||||||
"status",
|
"status",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue