fix linting errors

This commit is contained in:
Neil Martinsen-Burrell 2023-05-22 12:38:03 -05:00
parent 8adda8d327
commit 7d42c5e63b
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184
2 changed files with 3 additions and 9 deletions

View file

@ -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

View file

@ -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(