Fix bugs with email

This commit is contained in:
zandercymatics 2024-10-24 10:26:59 -06:00
parent d9ec108f58
commit 87d51c1002
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
4 changed files with 59 additions and 27 deletions

View file

@ -1205,7 +1205,8 @@ class DomainRequest(TimeStampedModel):
return False
def is_suborganization(self) -> bool:
"""Determines if this record is a suborganization or not"""
"""Determines if this record is a suborganization or not by checking if a suborganization exists,
and if it doesn't, determining if properties like requested_suborganization exist."""
if self.portfolio:
if self.sub_organization:
return True
@ -1216,12 +1217,18 @@ class DomainRequest(TimeStampedModel):
return False
def is_custom_suborganization(self) -> bool:
"""Used on the requesting entity form to determine if a user is trying to request
a new suborganization using the domain request form.
This only occurs when no suborganization is selected, but they've filled out
the requested_suborganization, suborganization_city, and suborganization_state_territory fields.
"""
if self.is_suborganization():
return not self.sub_organization and self.has_information_required_to_make_suborganization()
else:
return False
def has_information_required_to_make_suborganization(self):
def has_information_required_to_make_suborganization(self) -> bool:
"""Checks if we have all the information we need to create a new suborganization object.
Checks for a the existence of requested_suborganization, suborganization_city, suborganization_state_territory"""
if self.requested_suborganization and self.suborganization_city and self.suborganization_state_territory: