mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-04 02:03:32 +02:00
linted
This commit is contained in:
parent
0fea0c2f94
commit
ea043bf504
2 changed files with 3 additions and 9 deletions
|
@ -9,7 +9,6 @@ from django.core.validators import RegexValidator, MaxLengthValidator
|
|||
from django.utils.safestring import mark_safe
|
||||
|
||||
from api.views import DOMAIN_API_MESSAGES
|
||||
from registrar.management.commands.utility.terminal_helper import TerminalColors
|
||||
|
||||
from registrar.models import Contact, DomainApplication, DraftDomain, Domain
|
||||
from registrar.templatetags.url_helpers import public_site_url
|
||||
|
@ -586,7 +585,6 @@ class OtherContactsForm(RegistrarForm):
|
|||
error_messages={"required": "Enter a phone number for this contact."},
|
||||
)
|
||||
|
||||
|
||||
# Override clean in order to correct validation logic
|
||||
def clean(self):
|
||||
# NOTE: using self.cleaned_data directly apparently causes a CORS error
|
||||
|
@ -597,13 +595,12 @@ class OtherContactsForm(RegistrarForm):
|
|||
# I have spent hours tyring to figure out why, but have no idea...
|
||||
# so for now we will grab their values from the raw data...
|
||||
for i in self.data:
|
||||
if 'phone' in i or 'email' in i:
|
||||
if "phone" in i or "email" in i:
|
||||
# check if it has data
|
||||
field_value = self.data.get(i)
|
||||
# update the bool on whether the form is actually empty
|
||||
form_is_empty = field_value == "" or field_value is None
|
||||
|
||||
|
||||
if form_is_empty:
|
||||
# clear any errors raised by the form fields
|
||||
# (before this clean() method is run, each field
|
||||
|
@ -616,7 +613,6 @@ class OtherContactsForm(RegistrarForm):
|
|||
if field in self.errors:
|
||||
del self.errors[field]
|
||||
|
||||
|
||||
return cleaned
|
||||
|
||||
|
||||
|
|
|
@ -785,7 +785,6 @@ class DomainApplicationTests(TestWithUser, WebTest):
|
|||
|
||||
other_contacts_form = other_contacts_page.forms[0]
|
||||
|
||||
|
||||
# Minimal check to ensure the form is loaded with data (if this part of
|
||||
# the application doesn't work, we should be equipped with other unit
|
||||
# tests to flag it)
|
||||
|
@ -799,7 +798,6 @@ class DomainApplicationTests(TestWithUser, WebTest):
|
|||
other_contacts_form["other_contacts-0-email"] = ""
|
||||
other_contacts_form["other_contacts-0-phone"] = ""
|
||||
|
||||
|
||||
# Submit the now empty form
|
||||
result = other_contacts_form.submit()
|
||||
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue