mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-06 04:27:22 +02:00
fixed unit tests (still need to rethink how to handle deletion of CISA rep contacts)
This commit is contained in:
parent
d9cc947f6e
commit
7dc9dba833
6 changed files with 41 additions and 27 deletions
|
@ -649,14 +649,10 @@ class NoOtherContactsForm(BaseDeletableRegistrarForm):
|
|||
class CisaRepresentativeForm(BaseDeletableRegistrarForm):
|
||||
JOIN = "cisa_representative"
|
||||
|
||||
logger.debug("GETTING CISA REP")
|
||||
|
||||
def to_database(self, obj):
|
||||
logger.debug("SAVING CISA REP")
|
||||
if not self.is_valid():
|
||||
return
|
||||
contact = getattr(obj, "cisa_representative", None)
|
||||
logger.debug("EXISTING REP: %s" % contact)
|
||||
if contact is not None and not contact.has_more_than_one_join("cisa_representative_domain_requests"):
|
||||
# if contact exists in the database and is not joined to other entities
|
||||
super().to_database(contact)
|
||||
|
@ -665,7 +661,6 @@ class CisaRepresentativeForm(BaseDeletableRegistrarForm):
|
|||
# in either case, create a new contact and update it
|
||||
contact = Contact()
|
||||
super().to_database(contact)
|
||||
logger.debug("NEW REP: %s" % contact)
|
||||
obj.cisa_representative = contact
|
||||
obj.save()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue