-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1660 from cisagov/za/1659-hide-default-email
Ticket #1659: Add default to csv_export, readd content
- Loading branch information
Showing
4 changed files
with
6 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 #} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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)" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|