mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 18:56:15 +02:00
review changes
This commit is contained in:
parent
63c2b7907f
commit
21007ce869
3 changed files with 9 additions and 3 deletions
|
@ -2927,7 +2927,7 @@ class DomainAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
message = "Cannot connect to the registry"
|
message = "Cannot connect to the registry"
|
||||||
if not err.is_connection_error():
|
if not err.is_connection_error():
|
||||||
# If nothing is found, will default to returned err
|
# If nothing is found, will default to returned err
|
||||||
message = error_messages[err.code]
|
message = error_messages.get(err.code, err)
|
||||||
self.message_user(request, f"Error deleting this Domain: {message}", messages.ERROR)
|
self.message_user(request, f"Error deleting this Domain: {message}", messages.ERROR)
|
||||||
except TransitionNotAllowed:
|
except TransitionNotAllowed:
|
||||||
if obj.state == Domain.State.DELETED:
|
if obj.state == Domain.State.DELETED:
|
||||||
|
|
|
@ -750,7 +750,12 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
|
|
||||||
successTotalNameservers = len(oldNameservers) - deleteCount + addToDomainCount
|
successTotalNameservers = len(oldNameservers) - deleteCount + addToDomainCount
|
||||||
|
|
||||||
self._delete_hosts_if_not_used(hostsToDelete=deleted_values)
|
try:
|
||||||
|
self._delete_hosts_if_not_used(hostsToDelete=deleted_values)
|
||||||
|
except:
|
||||||
|
# the error will be logged in the erring function and we don't
|
||||||
|
# need this part to succeed in order to continue.s
|
||||||
|
pass
|
||||||
|
|
||||||
if successTotalNameservers < 2:
|
if successTotalNameservers < 2:
|
||||||
try:
|
try:
|
||||||
|
@ -1065,6 +1070,8 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
if responseCode != ErrorCode.COMMAND_COMPLETED_SUCCESSFULLY:
|
if responseCode != ErrorCode.COMMAND_COMPLETED_SUCCESSFULLY:
|
||||||
raise NameserverError(code=nsErrorCodes.BAD_DATA)
|
raise NameserverError(code=nsErrorCodes.BAD_DATA)
|
||||||
|
|
||||||
|
# addAndRemoveHostsFromDomain removes the hosts from the domain object,
|
||||||
|
# but we still need to delete the object themselves
|
||||||
self._delete_hosts_if_not_used(hostsToDelete=deleted_values)
|
self._delete_hosts_if_not_used(hostsToDelete=deleted_values)
|
||||||
|
|
||||||
logger.debug("Deleting non-registrant contacts for %s", self.name)
|
logger.debug("Deleting non-registrant contacts for %s", self.name)
|
||||||
|
|
|
@ -1676,7 +1676,6 @@ class MockEppLib(TestCase):
|
||||||
def mockDeleteHostCommands(self, _request, cleaned):
|
def mockDeleteHostCommands(self, _request, cleaned):
|
||||||
host = getattr(_request, "name", None)
|
host = getattr(_request, "name", None)
|
||||||
if "sharedhost.com" in host:
|
if "sharedhost.com" in host:
|
||||||
print("raising registry error")
|
|
||||||
raise RegistryError(code=ErrorCode.OBJECT_ASSOCIATION_PROHIBITS_OPERATION, note="ns1.sharedhost.com")
|
raise RegistryError(code=ErrorCode.OBJECT_ASSOCIATION_PROHIBITS_OPERATION, note="ns1.sharedhost.com")
|
||||||
return MagicMock(
|
return MagicMock(
|
||||||
res_data=[self.mockDataHostChange],
|
res_data=[self.mockDataHostChange],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue