use update function to delete hosts

This commit is contained in:
matthewswspence 2024-12-09 13:34:34 -06:00
parent 5e7823a6ec
commit e87c4f78f1
No known key found for this signature in database
GPG key ID: FB458202A7852BA4
2 changed files with 4 additions and 3 deletions

View file

@ -1074,8 +1074,9 @@ class Domain(TimeStampedModel, DomainHelper):
hostsToDelete, _ = self.createDeleteHostList(nameservers)
logger.debug("HostsToDelete from %s inside _delete_subdomains -> %s", self.name, hostsToDelete)
for objSet in hostsToDelete:
self._delete_hosts_if_not_used(objSet.hosts)
self.addAndRemoveHostsFromDomain(None, hostsToDelete=nameservers)
# for objSet in hostsToDelete:
# self._delete_hosts_if_not_used(objSet.hosts)
def _delete_domain(self):
"""This domain should be deleted from the registry

View file

@ -228,7 +228,7 @@ class TestDomainAdminAsStaff(MockEppLib):
"""
Scenario: Domain deletion is unsuccessful
When the domain is deleted and has shared subdomains
Then a user-friendly success message is returned for displaying on the web
Then a user-friendly error message is returned for displaying on the web
And `state` is not set to `DELETED`
"""
domain, _ = Domain.objects.get_or_create(name="sharingiscaring.gov", state=Domain.State.ON_HOLD)