mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-01 07:26:34 +02:00
updated columns and display name for senior official in dja
This commit is contained in:
parent
1efa137e8b
commit
968d8610fa
2 changed files with 5 additions and 3 deletions
|
@ -1222,9 +1222,9 @@ class ContactAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
|||
class SeniorOfficialAdmin(ListHeaderAdmin):
|
||||
"""Custom Senior Official Admin class."""
|
||||
|
||||
search_fields = ["first_name", "last_name", "email"]
|
||||
search_fields = ["first_name", "last_name", "email", "federal_agency__agency"]
|
||||
search_help_text = "Search by first name, last name or email."
|
||||
list_display = ["first_name", "last_name", "email", "federal_agency"]
|
||||
list_display = ["federal_agency", "first_name", "last_name", "email"]
|
||||
|
||||
# this ordering effects the ordering of results
|
||||
# in autocomplete_fields for Senior Official
|
||||
|
|
|
@ -55,7 +55,9 @@ class SeniorOfficial(TimeStampedModel):
|
|||
return " ".join(names) if names else "Unknown"
|
||||
|
||||
def __str__(self):
|
||||
if self.first_name or self.last_name:
|
||||
if self.federal_agency and (self.first_name or self.last_name):
|
||||
return self.get_formatted_name() + " of " + self.federal_agency.__str__()
|
||||
elif self.first_name or self.last_name:
|
||||
return self.get_formatted_name()
|
||||
elif self.pk:
|
||||
return str(self.pk)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue