Skip to content

Commit

Permalink
Merge pull request #1660 from cisagov/za/1659-hide-default-email
Browse files Browse the repository at this point in the history
Ticket #1659: Add default to csv_export, readd content
  • Loading branch information
zandercymatics authored Jan 19, 2024
2 parents f4bc35d + 8bcdbec commit f31ca96
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/registrar/templates/domain_security_email.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1>Security email</h1>
<button
type="submit"
class="usa-button"
>{% if form.security_email.value is None or form.security_email.value == "[email protected]"%}Add security email{% else %}Save{% endif %}</button>
>{% if form.security_email.value is None or form.security_email.value == "[email protected]" or form.security_email.value == "[email protected]"%}Add security email{% else %}Save{% endif %}</button>
</form>

{% endblock %} {# domain_content #}
2 changes: 1 addition & 1 deletion src/registrar/tests/test_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,[email protected],On hold,2023-05-25\n"
"defaultsecurity.gov,Federal - Executive,World War I Centennial Commission,[email protected],Ready"
"defaultsecurity.gov,Federal - Executive,World War I Centennial Commission,(blank),Ready"
)

# Normalize line endings and remove commas,
Expand Down
2 changes: 1 addition & 1 deletion src/registrar/utility/csv_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def write_row(writer, columns, domain_info):
if security_contacts:
security_email = security_contacts[0].email

invalid_emails = {"[email protected]"}
invalid_emails = {"[email protected]", "[email protected]"}
# 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)"
Expand Down
4 changes: 3 additions & 1 deletion src/registrar/views/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "[email protected]":

invalid_emails = ["[email protected]", "[email protected]"]
if security_contact is None or security_contact.email in invalid_emails:
initial["security_email"] = None
return initial
initial["security_email"] = security_contact.email
Expand Down

0 comments on commit f31ca96

Please sign in to comment.