diff --git a/src/registrar/migrations/0020_remove_domaininformation_security_email.py b/src/registrar/migrations/0020_remove_domaininformation_security_email.py new file mode 100644 index 000000000..9742c294a --- /dev/null +++ b/src/registrar/migrations/0020_remove_domaininformation_security_email.py @@ -0,0 +1,16 @@ +# Generated by Django 4.2 on 2023-05-17 17:05 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("registrar", "0019_alter_domainapplication_organization_type"), + ] + + operations = [ + migrations.RemoveField( + model_name="domaininformation", + name="security_email", + ), + ] diff --git a/src/registrar/models/domain_information.py b/src/registrar/models/domain_information.py index 6561a82b4..c7832266b 100644 --- a/src/registrar/models/domain_information.py +++ b/src/registrar/models/domain_information.py @@ -200,12 +200,6 @@ class DomainInformation(TimeStampedModel): blank=True, help_text="Acknowledged .gov acceptable use policy", ) - security_email = models.EmailField( - max_length=320, - null=True, - blank=True, - help_text="Security email for public use", - ) def __str__(self): try: diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py index 6242496d1..d0fa8952e 100644 --- a/src/registrar/views/domain.py +++ b/src/registrar/views/domain.py @@ -90,7 +90,7 @@ class DomainNameserversView(DomainPermission, FormMixin, DetailView): domain.set_nameservers(nameservers) messages.success( - self.request, "The name servers for this domain have been updated" + self.request, "The name servers for this domain have been updated." ) # superclass has the redirect return super().form_valid(formset) @@ -129,17 +129,13 @@ class DomainSecurityEmailView(DomainPermission, FormMixin, DetailView): def form_valid(self, form): """The form is valid, call setter in model.""" - # Set the security email from the from - try: - new_email = form.cleaned_data["security_email"] - except KeyError: - # no server information in this field, skip it - pass + # Set the security email from the form + new_email = form.cleaned_data["security_email"] domain = self.get_object() domain.set_security_email(new_email) messages.success( - self.request, "The security email for this domain have been updated" + self.request, "The security email for this domain have been updated." ) # superclass has the redirect return redirect(self.get_success_url())