mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-17 18:09:25 +02:00
linted
This commit is contained in:
parent
3d45daab16
commit
8d46b76376
2 changed files with 11 additions and 9 deletions
|
@ -557,14 +557,15 @@ class DomainRequest(TimeStampedModel):
|
||||||
|
|
||||||
# This ensures that if we have prefilled data, the form is prepopulated
|
# This ensures that if we have prefilled data, the form is prepopulated
|
||||||
if self.cisa_representative_first_name is not None or self.cisa_representative_last_name is not None:
|
if self.cisa_representative_first_name is not None or self.cisa_representative_last_name is not None:
|
||||||
self.has_cisa_representative = self.cisa_representative_first_name != "" and self.cisa_representative_last_name != ""
|
self.has_cisa_representative = (
|
||||||
|
self.cisa_representative_first_name != "" and self.cisa_representative_last_name != ""
|
||||||
|
)
|
||||||
|
|
||||||
# This check is required to ensure that the form doesn't start out checked
|
# This check is required to ensure that the form doesn't start out checked
|
||||||
if self.has_cisa_representative is not None:
|
if self.has_cisa_representative is not None:
|
||||||
self.has_cisa_representative = (
|
self.has_cisa_representative = (
|
||||||
(self.cisa_representative_first_name != "" and self.cisa_representative_first_name is not None)
|
self.cisa_representative_first_name != "" and self.cisa_representative_first_name is not None
|
||||||
and (self.cisa_representative_last_name != "" and self.cisa_representative_last_name is not None)
|
) and (self.cisa_representative_last_name != "" and self.cisa_representative_last_name is not None)
|
||||||
)
|
|
||||||
|
|
||||||
# This ensures that if we have prefilled data, the form is prepopulated
|
# This ensures that if we have prefilled data, the form is prepopulated
|
||||||
if self.anything_else is not None:
|
if self.anything_else is not None:
|
||||||
|
@ -1033,7 +1034,8 @@ class DomainRequest(TimeStampedModel):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _cisa_rep_check(self):
|
def _cisa_rep_check(self):
|
||||||
# Either does not have a CISA rep, OR has a CISA rep + both first name and last name are NOT empty and are NOT an empty string
|
# Either does not have a CISA rep, OR has a CISA rep + both first name
|
||||||
|
# and last name are NOT empty and are NOT an empty string
|
||||||
return (
|
return (
|
||||||
self.has_cisa_representative is True
|
self.has_cisa_representative is True
|
||||||
and self.cisa_representative_first_name is not None
|
and self.cisa_representative_first_name is not None
|
||||||
|
|
|
@ -1884,7 +1884,7 @@ class TestDomainRequestIncomplete(TestCase):
|
||||||
# therefore, our expected will be True
|
# therefore, our expected will be True
|
||||||
{
|
{
|
||||||
"has_cisa_representative": True,
|
"has_cisa_representative": True,
|
||||||
# Above will be overridden to False if cisa_representative_first_name is None bc of sync_yes_no_form_fields
|
# Above will be overridden to False if cisa_representative_first_name is None
|
||||||
"cisa_representative_first_name": None,
|
"cisa_representative_first_name": None,
|
||||||
"cisa_representative_last_name": None,
|
"cisa_representative_last_name": None,
|
||||||
"cisa_representative_email": None,
|
"cisa_representative_email": None,
|
||||||
|
@ -1898,8 +1898,8 @@ class TestDomainRequestIncomplete(TestCase):
|
||||||
# Email - None
|
# Email - None
|
||||||
# Anything Else Radio - Yes
|
# Anything Else Radio - Yes
|
||||||
# Anything Else Text - None
|
# Anything Else Text - None
|
||||||
# NOTE: We should never have an instance where only firstname or only lastname are populated (they are both required)
|
# NOTE: We should never have an instance where only firstname or only lastname are populated
|
||||||
# However, if this happens, the application will default to False for has_cisa_representative
|
# (they are both required)
|
||||||
{
|
{
|
||||||
"has_cisa_representative": True,
|
"has_cisa_representative": True,
|
||||||
# Above will be overridden to False if cisa_representative_first_name is None or
|
# Above will be overridden to False if cisa_representative_first_name is None or
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue