Merge branch 'za/1501-users-delete-domain-records' of https://github.com/cisagov/manage.get.gov into za/1501-users-delete-domain-records

This commit is contained in:
zandercymatics 2024-01-23 08:27:16 -07:00
commit 0d238e8793
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 2 additions and 1 deletions

View file

@ -236,6 +236,7 @@ class LoggedInTests(TestWithUser):
# Trigger the delete logic
response = self.client.post(reverse("application-delete", kwargs={"pk": application.pk}), follow=True)
# igorville is now deleted
self.assertNotContains(response, "igorville.gov")
# Check if the orphaned contact was deleted

View file

@ -694,7 +694,7 @@ class DomainApplicationDeleteView(DomainApplicationPermissionDeleteView):
submitter = self._get_contacts_by_id([submitter.id]).first() if submitter is not None else None
other_contacts = self._get_contacts_by_id(other_contact_ids)
# Pair each contact with its related name
# Pair each contact with its db related name for use in checking if it has joins
checked_contacts = [(ao, "authorizing_official"), (submitter, "submitted_applications")]
checked_contacts.extend((contact, "contact_applications") for contact in other_contacts)