mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-25 03:58:39 +02:00
Merge pull request #1660 from cisagov/za/1659-hide-default-email
Ticket #1659: Add default to csv_export, readd content
This commit is contained in:
commit
f31ca96aac
4 changed files with 6 additions and 4 deletions
|
@ -20,7 +20,7 @@
|
|||
<button
|
||||
type="submit"
|
||||
class="usa-button"
|
||||
>{% if form.security_email.value is None or form.security_email.value == "dotgov@cisa.dhs.gov"%}Add security email{% else %}Save{% endif %}</button>
|
||||
>{% 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 %}</button>
|
||||
</form>
|
||||
|
||||
{% endblock %} {# domain_content #}
|
||||
|
|
|
@ -399,7 +399,7 @@ class ExportDataTest(MockEppLib):
|
|||
"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,
|
||||
|
|
|
@ -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)"
|
||||
|
|
|
@ -568,7 +568,9 @@ class DomainSecurityEmailView(DomainFormBaseView):
|
|||
"""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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue