Merge branch 'main' into nl/3275-slowness-admin-tables

This commit is contained in:
CuriousX 2025-01-28 08:50:38 -07:00 committed by GitHub
commit 9b91c93387
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 14 deletions

View file

@ -3,10 +3,6 @@ name: Testing
on: on:
push: push:
paths-ignore:
- 'docs/**'
- '**.md'
- '.gitignore'
branches: branches:
- main - main
pull_request: pull_request:

View file

@ -1222,9 +1222,9 @@ class ContactAdmin(ListHeaderAdmin, ImportExportModelAdmin):
class SeniorOfficialAdmin(ListHeaderAdmin): class SeniorOfficialAdmin(ListHeaderAdmin):
"""Custom Senior Official Admin class.""" """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." 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 # this ordering effects the ordering of results
# in autocomplete_fields for Senior Official # in autocomplete_fields for Senior Official

View file

@ -55,7 +55,9 @@ class SeniorOfficial(TimeStampedModel):
return " ".join(names) if names else "Unknown" return " ".join(names) if names else "Unknown"
def __str__(self): 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() return self.get_formatted_name()
elif self.pk: elif self.pk:
return str(self.pk) return str(self.pk)

View file

@ -2,27 +2,23 @@
Hi,{% if domain_manager and domain_manager.first_name %} {{ domain_manager.first_name }}.{% endif %} Hi,{% if domain_manager and domain_manager.first_name %} {{ domain_manager.first_name }}.{% endif %}
A domain manager was invited to {{ domain.name }}. A domain manager was invited to {{ domain.name }}.
DOMAIN: {{ domain.name }}
INVITED BY: {{ requestor_email }} INVITED BY: {{ requestor_email }}
INVITED ON: {{date}} INVITED ON: {{date}}
MANAGER INVITED: {{ invited_email_address }} MANAGER INVITED: {{ invited_email_address }}
---------------------------------------------------------------- ----------------------------------------------------------------
NEXT STEPS NEXT STEPS
The person who received the invitation will become a domain manager once they log in to the The person who received the invitation will become a domain manager once they log in to the
.gov registrar. They'll need to access the registrar using a Login.gov account that's .gov registrar. They'll need to access the registrar using a Login.gov account that's
associated with the invited email address. associated with the invited email address.
If you need to cancel this invitation or remove the domain manager (because they've already If you need to cancel this invitation or remove the domain manager, you can do that by going to
logged in), you can do that by going to this domain in the .gov registrar <https://manage.get.gov/>. this domain in the .gov registrar <https://manage.get.gov/>.
WHY DID YOU RECEIVE THIS EMAIL? WHY DID YOU RECEIVE THIS EMAIL?
Youre listed as a domain manager for {{ domain.name }}, so youll receive a notification whenever Youre listed as a domain manager for {{ domain.name }}, so youll receive a notification whenever
someone is invited to manage that domain. someone is invited to manage that domain.