mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-17 01:57:03 +02:00
sorting on user and domain in autocomplete fields in UserDomainRole
This commit is contained in:
parent
8867d141d8
commit
d633b36839
1 changed files with 8 additions and 0 deletions
|
@ -266,6 +266,10 @@ class MyUserAdmin(BaseUserAdmin):
|
||||||
"groups",
|
"groups",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# this ordering effects the ordering of results
|
||||||
|
# in autocomplete_fields for user
|
||||||
|
ordering = ['first_name', 'last_name', 'email']
|
||||||
|
|
||||||
# Let's define First group
|
# Let's define First group
|
||||||
# (which should in theory be the ONLY group)
|
# (which should in theory be the ONLY group)
|
||||||
def group(self, obj):
|
def group(self, obj):
|
||||||
|
@ -843,6 +847,10 @@ class DomainAdmin(ListHeaderAdmin):
|
||||||
"state",
|
"state",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# this ordering effects the ordering of results
|
||||||
|
# in autocomplete_fields for domain
|
||||||
|
ordering = ['name']
|
||||||
|
|
||||||
def organization_type(self, obj):
|
def organization_type(self, obj):
|
||||||
return obj.domain_info.get_organization_type_display()
|
return obj.domain_info.get_organization_type_display()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue