mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-04 10:13:30 +02:00
Remove print statements
This commit is contained in:
parent
affc35398d
commit
0fea0c2f94
1 changed files with 3 additions and 35 deletions
|
@ -591,27 +591,6 @@ class OtherContactsForm(RegistrarForm):
|
||||||
def clean(self):
|
def clean(self):
|
||||||
# NOTE: using self.cleaned_data directly apparently causes a CORS error
|
# NOTE: using self.cleaned_data directly apparently causes a CORS error
|
||||||
cleaned = super().clean()
|
cleaned = super().clean()
|
||||||
|
|
||||||
logger.info(f"""
|
|
||||||
{TerminalColors.MAGENTA}form data:
|
|
||||||
{TerminalColors.OKBLUE}{self.data}
|
|
||||||
|
|
||||||
{TerminalColors.MAGENTA}form cleaned:
|
|
||||||
{TerminalColors.OKBLUE}{cleaned}
|
|
||||||
|
|
||||||
|
|
||||||
{self.data.items}
|
|
||||||
{TerminalColors.ENDC}
|
|
||||||
|
|
||||||
""")
|
|
||||||
|
|
||||||
# for f in self.fields:
|
|
||||||
# logger.info(f"""
|
|
||||||
# {TerminalColors.YELLOW}{f}
|
|
||||||
# {self.data.get(f)}
|
|
||||||
# {TerminalColors.ENDC}
|
|
||||||
# """)
|
|
||||||
|
|
||||||
form_is_empty = all(v is None or v == "" for v in cleaned.values())
|
form_is_empty = all(v is None or v == "" for v in cleaned.values())
|
||||||
|
|
||||||
# NOTE: Phone number and email do NOT show up in cleaned values.
|
# NOTE: Phone number and email do NOT show up in cleaned values.
|
||||||
|
@ -619,17 +598,10 @@ class OtherContactsForm(RegistrarForm):
|
||||||
# so for now we will grab their values from the raw data...
|
# so for now we will grab their values from the raw data...
|
||||||
for i in self.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)
|
field_value = self.data.get(i)
|
||||||
logger.info(f"""
|
# update the bool on whether the form is actually empty
|
||||||
{TerminalColors.YELLOW}{i}
|
|
||||||
{self.data.get(i)}
|
|
||||||
{TerminalColors.ENDC}
|
|
||||||
""")
|
|
||||||
form_is_empty = field_value == "" or field_value is None
|
form_is_empty = field_value == "" or field_value is None
|
||||||
logger.info(f"""
|
|
||||||
{TerminalColors.OKCYAN}empty? {form_is_empty}
|
|
||||||
{TerminalColors.ENDC}
|
|
||||||
""")
|
|
||||||
|
|
||||||
|
|
||||||
if form_is_empty:
|
if form_is_empty:
|
||||||
|
@ -641,11 +613,7 @@ class OtherContactsForm(RegistrarForm):
|
||||||
# NOTE: we cannot just clear() the errors list.
|
# NOTE: we cannot just clear() the errors list.
|
||||||
# That causes problems.
|
# That causes problems.
|
||||||
for field in self.fields:
|
for field in self.fields:
|
||||||
if field in self.errors: # and field in cleaned
|
if field in self.errors:
|
||||||
logger.info(f"""
|
|
||||||
{TerminalColors.FAIL}removing {field}
|
|
||||||
{TerminalColors.ENDC}
|
|
||||||
""")
|
|
||||||
del self.errors[field]
|
del self.errors[field]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue