From e6812afe8bd6f243404cd1875a423f089211bc4c Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Fri, 19 Jan 2024 09:13:04 -0700 Subject: [PATCH 1/2] Add default to csv_export, readd content --- src/registrar/templates/domain_security_email.html | 2 +- src/registrar/utility/csv_export.py | 2 +- src/registrar/views/domain.py | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/registrar/templates/domain_security_email.html b/src/registrar/templates/domain_security_email.html index 4054186da5..e1755f85e5 100644 --- a/src/registrar/templates/domain_security_email.html +++ b/src/registrar/templates/domain_security_email.html @@ -20,7 +20,7 @@

Security email

+ >{% if form.security_email.value is None or form.security_email.value == "dotgov@cisa.dhs.gov" or form.security_email.value == "registrar@dotgov.gov"%}Add security email{% else %}Save{% endif %} {% endblock %} {# domain_content #} diff --git a/src/registrar/utility/csv_export.py b/src/registrar/utility/csv_export.py index 52afb218be..3924c03c41 100644 --- a/src/registrar/utility/csv_export.py +++ b/src/registrar/utility/csv_export.py @@ -38,7 +38,7 @@ def write_row(writer, columns, domain_info): if security_contacts: security_email = security_contacts[0].email - invalid_emails = {"registrar@dotgov.gov"} + invalid_emails = {"registrar@dotgov.gov", "dotgov@cisa.dhs.gov"} # These are default emails that should not be displayed in the csv report if security_email is not None and security_email.lower() in invalid_emails: security_email = "(blank)" diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py index 4d47a6f591..f3e0a3b9d5 100644 --- a/src/registrar/views/domain.py +++ b/src/registrar/views/domain.py @@ -568,7 +568,9 @@ def get_initial(self): """The initial value for the form.""" initial = super().get_initial() security_contact = self.object.security_contact - if security_contact is None or security_contact.email == "dotgov@cisa.dhs.gov": + + invalid_emails = ["dotgov@cisa.dhs.gov", "registrar@dotgov.gov"] + if security_contact is None or security_contact.email in invalid_emails: initial["security_email"] = None return initial initial["security_email"] = security_contact.email From 8bcdbec641835566db4bf0ddfe6b7d2a95c2cfa3 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Fri, 19 Jan 2024 09:31:30 -0700 Subject: [PATCH 2/2] Fix unit test --- src/registrar/tests/test_reports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/tests/test_reports.py b/src/registrar/tests/test_reports.py index b1c631b3d0..a85fb58499 100644 --- a/src/registrar/tests/test_reports.py +++ b/src/registrar/tests/test_reports.py @@ -399,7 +399,7 @@ def test_export_domains_to_writer_security_emails(self): "adomain10.gov,Federal,Armed Forces Retirement Home,Ready\n" "adomain2.gov,Interstate,(blank),Dns needed\n" "ddomain3.gov,Federal,Armed Forces Retirement Home,123@mail.gov,On hold,2023-05-25\n" - "defaultsecurity.gov,Federal - Executive,World War I Centennial Commission,dotgov@cisa.dhs.gov,Ready" + "defaultsecurity.gov,Federal - Executive,World War I Centennial Commission,(blank),Ready" ) # Normalize line endings and remove commas,