Skip to content

Commit

Permalink
refactor group custom list_display
Browse files Browse the repository at this point in the history
  • Loading branch information
rachidatecs committed Sep 29, 2023
1 parent b4506d0 commit 0c05518
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/registrar/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ class MyUserAdmin(BaseUserAdmin):
# Let's define First group
# (which should in theory be the ONLY group)
def group(self, obj):
if f"{obj.groups.first()}" == "full_access_group":
if obj.groups.filter(name="full_access_group").exists():
return "Super User"
elif f"{obj.groups.first()}" == "cisa_analysts_group":
elif obj.groups.filter(name="cisa_analysts_group").exists():
return "Analyst"
return ""

Expand Down

0 comments on commit 0c05518

Please sign in to comment.