mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-12 15:34:50 +02:00
updated logic for deletion of CISA contact (deleting association only...)
This commit is contained in:
parent
7dc9dba833
commit
6ecd9e59fc
1 changed files with 7 additions and 2 deletions
|
@ -654,7 +654,12 @@ class CisaRepresentativeForm(BaseDeletableRegistrarForm):
|
||||||
return
|
return
|
||||||
contact = getattr(obj, "cisa_representative", None)
|
contact = getattr(obj, "cisa_representative", None)
|
||||||
if contact is not None and not contact.has_more_than_one_join("cisa_representative_domain_requests"):
|
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
|
if self.form_data_marked_for_deletion:
|
||||||
|
# remove the CISA contact from this domain request
|
||||||
|
obj.cisa_representative = None
|
||||||
|
#QUESTION - should we also delete the contact object if it is not joined to other entities?
|
||||||
|
else:
|
||||||
|
# update existing contact if it is not joined to other enttities
|
||||||
super().to_database(contact)
|
super().to_database(contact)
|
||||||
else:
|
else:
|
||||||
# no contact exists OR contact exists which is joined also to other entities;
|
# no contact exists OR contact exists which is joined also to other entities;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue