mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-21 10:16:13 +02:00
changes so far
This commit is contained in:
parent
30d7e561ef
commit
f40ef08cba
2 changed files with 19 additions and 3 deletions
|
@ -1766,7 +1766,7 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
|||
"Contacts",
|
||||
{
|
||||
"fields": [
|
||||
"converted_senior_official",
|
||||
"display_converted_senior_official",
|
||||
"other_contacts",
|
||||
"no_other_contacts_rationale",
|
||||
"cisa_representative_first_name",
|
||||
|
@ -1832,7 +1832,7 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
|||
"alternative_domains",
|
||||
"is_election_board",
|
||||
"status_history",
|
||||
"converted_senior_official",
|
||||
"display_converted_senior_official",
|
||||
"converted_federal_type",
|
||||
"converted_federal_agency",
|
||||
"converted_state_territory",
|
||||
|
@ -1865,7 +1865,6 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
|||
"approved_domain",
|
||||
"requested_domain",
|
||||
"creator",
|
||||
"senior_official",
|
||||
"investigator",
|
||||
"portfolio",
|
||||
"sub_organization",
|
||||
|
@ -1879,6 +1878,21 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
|||
|
||||
change_form_template = "django/admin/domain_request_change_form.html"
|
||||
|
||||
def display_converted_senior_official(self, obj):
|
||||
so = obj.converted_senior_official
|
||||
if so:
|
||||
parts = []
|
||||
if so.first_name or so.last_name:
|
||||
full_name = f"{so.first_name or ''} {so.last_name or ''}".strip()
|
||||
parts.append(full_name)
|
||||
if so.title:
|
||||
parts.append(so.title)
|
||||
if so.email:
|
||||
parts.append(so.email)
|
||||
if so.phone:
|
||||
parts.append(str(so.phone))
|
||||
return "\n\n".join(parts) if parts else "N/A"
|
||||
|
||||
# Trigger action when a fieldset is changed
|
||||
def save_model(self, request, obj, form, change):
|
||||
"""Custom save_model definition that handles edge cases"""
|
||||
|
|
|
@ -1508,6 +1508,8 @@ class TestDomainRequestAdmin(MockEppLib):
|
|||
self.assertContains(response, "Meoward Jones")
|
||||
|
||||
# == Check for the senior_official == #
|
||||
print("SENIOR OFFICIAL")
|
||||
print(response.content.decode("utf-8"))
|
||||
self.assertContains(response, "testy@town.com", count=2)
|
||||
expected_so_fields = [
|
||||
# Field, expected value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue