diff --git a/src/registrar/forms/domain.py b/src/registrar/forms/domain.py index cff8f8edd..e6fbc8fee 100644 --- a/src/registrar/forms/domain.py +++ b/src/registrar/forms/domain.py @@ -7,6 +7,7 @@ from phonenumber_field.widgets import RegionalPhoneNumberWidget from ..models import Contact + class DomainAddUserForm(forms.Form): """Form for adding a user to a domain.""" @@ -46,19 +47,13 @@ class ContactForm(forms.ModelForm): # the database fields have blank=True so ModelForm doesn't create # required fields by default. Use this list in __init__ to mark each # of these fields as required - required = [ - "first_name", - "last_name", - "title", - "email", - "phone" - ] + required = ["first_name", "last_name", "title", "email", "phone"] def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # take off maxlength attribute for the phone number field # which interferes with out input_with_errors template tag - self.fields['phone'].widget.attrs.pop('maxlength', None) + self.fields["phone"].widget.attrs.pop("maxlength", None) for field_name in self.required: self.fields[field_name].required = True diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py index 5cf050319..989361d1e 100644 --- a/src/registrar/views/domain.py +++ b/src/registrar/views/domain.py @@ -67,7 +67,6 @@ class DomainAuthorizingOfficialView(DomainPermission, FormMixin, DetailView): def form_valid(self, form): """The form is valid, save the authorizing official.""" - domain = self.get_object() form.save() messages.success(