sorting on user and domain in autocomplete fields in UserDomainRole

This commit is contained in:
David Kennedy 2023-12-15 19:53:45 -05:00
parent 8867d141d8
commit d633b36839
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B

View file

@ -266,6 +266,10 @@ class MyUserAdmin(BaseUserAdmin):
"groups",
)
# this ordering effects the ordering of results
# in autocomplete_fields for user
ordering = ['first_name', 'last_name', 'email']
# Let's define First group
# (which should in theory be the ONLY group)
def group(self, obj):
@ -843,6 +847,10 @@ class DomainAdmin(ListHeaderAdmin):
"state",
]
# this ordering effects the ordering of results
# in autocomplete_fields for domain
ordering = ['name']
def organization_type(self, obj):
return obj.domain_info.get_organization_type_display()