finished changing parameters for has_more_than_one_join to pass array of reverse_joins rather than individual join

This commit is contained in:
David Kennedy 2024-01-12 17:54:30 -05:00
parent 0920246593
commit 579b890996
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
2 changed files with 2 additions and 2 deletions

View file

@ -556,7 +556,7 @@ class YourContactForm(RegistrarForm):
if not self.is_valid():
return
contact = getattr(obj, "submitter", None)
if contact is not None and not any(contact.has_more_than_one_join(rel, "submitted_applications") for rel in self.REVERSE_JOINS):
if contact is not None and not contact.has_more_than_one_join(self.REVERSE_JOINS, "submitted_applications"):
# if contact exists in the database and is not joined to other entities
super().to_database(contact)
else:

View file

@ -258,7 +258,7 @@ class AuthorizingOfficialContactForm(ContactForm):
# get db object
db_ao = Contact.objects.get(id=self.instance.id)
logger.info(f"db_ao.information_authorizing_official {db_ao.information_authorizing_official}")
if self.domainInfo and any(db_ao.has_more_than_one_join(rel, "information_authorizing_official") for rel in self.REVERSE_JOINS):
if self.domainInfo and db_ao.has_more_than_one_join(self.REVERSE_JOINS, "information_authorizing_official"):
logger.info(f"domain info => {self.domainInfo}")
logger.info(f"authorizing official id => {self.domainInfo.authorizing_official.id}")
contact = Contact()