Merge branch 'main' into za/1901-allow-analysts-to-customize-action-needed-emails

This commit is contained in:
zandercymatics 2024-07-02 11:29:08 -06:00
commit 083ed6fb25
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
46 changed files with 575 additions and 563 deletions

View file

@ -266,7 +266,7 @@ class DomainRequest(TimeStampedModel):
"""Defines common action needed reasons for domain requests"""
ELIGIBILITY_UNCLEAR = ("eligibility_unclear", "Unclear organization eligibility")
QUESTIONABLE_AUTHORIZING_OFFICIAL = ("questionable_authorizing_official", "Questionable authorizing official")
QUESTIONABLE_SENIOR_OFFICIAL = ("questionable_senior_official", "Questionable senior official")
ALREADY_HAS_DOMAINS = ("already_has_domains", "Already has domains")
BAD_NAME = ("bad_name", "Doesnt meet naming requirements")
OTHER = ("other", "Other (no auto-email sent)")
@ -423,11 +423,11 @@ class DomainRequest(TimeStampedModel):
blank=True,
)
authorizing_official = models.ForeignKey(
senior_official = models.ForeignKey(
"registrar.Contact",
null=True,
blank=True,
related_name="authorizing_official",
related_name="senior_official",
on_delete=models.PROTECT,
)
@ -1170,8 +1170,8 @@ class DomainRequest(TimeStampedModel):
and self.zipcode is None
)
def _is_authorizing_official_complete(self):
return self.authorizing_official is not None
def _is_senior_official_complete(self):
return self.senior_official is not None
def _is_requested_domain_complete(self):
return self.requested_domain is not None
@ -1233,10 +1233,10 @@ class DomainRequest(TimeStampedModel):
has_profile_feature_flag = flag_is_active(request, "profile_feature")
return (
self._is_organization_name_and_address_complete()
and self._is_authorizing_official_complete()
and self._is_senior_official_complete()
and self._is_requested_domain_complete()
and self._is_purpose_complete()
# NOTE: This flag leaves submitter as empty (request wont submit) hence preset to True
# NOTE: This flag leaves submitter as empty (request wont submit) hence set to True
and (self._is_submitter_complete() if not has_profile_feature_flag else True)
and self._is_other_contacts_complete()
and self._is_additional_details_complete()