This commit is contained in:
CocoByte 2024-06-10 13:08:32 -06:00
parent 3d45daab16
commit 8d46b76376
No known key found for this signature in database
GPG key ID: BBFAA2526384C97F
2 changed files with 11 additions and 9 deletions

View file

@ -557,14 +557,15 @@ class DomainRequest(TimeStampedModel):
# 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:
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
if self.has_cisa_representative is not None:
self.has_cisa_representative = (
(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)
)
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)
# This ensures that if we have prefilled data, the form is prepopulated
if self.anything_else is not None:
@ -1033,7 +1034,8 @@ class DomainRequest(TimeStampedModel):
return False
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 (
self.has_cisa_representative is True
and self.cisa_representative_first_name is not None