mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-25 20:18:38 +02:00
Add delete functionality for sec email
This commit is contained in:
parent
8da6578b46
commit
3625fc0927
1 changed files with 6 additions and 1 deletions
|
@ -21,6 +21,7 @@ from registrar.models import (
|
|||
User,
|
||||
UserDomainRole,
|
||||
)
|
||||
from registrar.models.public_contact import PublicContact
|
||||
|
||||
from ..forms import (
|
||||
ContactForm,
|
||||
|
@ -297,7 +298,11 @@ class DomainSecurityEmailView(DomainPermissionView, FormMixin):
|
|||
"""The form is valid, call setter in model."""
|
||||
|
||||
# Set the security email from the form
|
||||
new_email = form.cleaned_data.get("security_email", "")
|
||||
new_email: str = form.cleaned_data.get("security_email", "")
|
||||
|
||||
# If we pass nothing for the sec email, set to the default
|
||||
if new_email is None or new_email.strip() == "":
|
||||
new_email = PublicContact.get_default_security().email
|
||||
|
||||
domain = self.get_object()
|
||||
contact = domain.security_contact
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue