wip commit

This commit is contained in:
David Kennedy 2023-09-21 12:17:57 -04:00
parent 4db5b94b36
commit 34106286a6
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
4 changed files with 48 additions and 5 deletions

View file

@ -311,7 +311,17 @@ class DomainAdmin(ListHeaderAdmin):
obj.place_client_hold()
obj.save()
except Exception as err:
self.message_user(request, err, messages.ERROR)
# if error is an error from the registry, display useful
# and readable error
if err.code:
self.message_user(
request,
"Error placing the hold with the registry: {err}",
messages.ERROR
)
else:
# all other type error messages, display the error
self.message_user(request, err, messages.ERROR)
else:
self.message_user(
request,
@ -328,7 +338,17 @@ class DomainAdmin(ListHeaderAdmin):
obj.revert_client_hold()
obj.save()
except Exception as err:
self.message_user(request, err, messages.ERROR)
# if error is an error from the registry, display useful
# and readable error
if err.code:
self.message_user(
request,
"Error removing the hold in the registry: {err}",
messages.ERROR
)
else:
# all other type error messages, display the error
self.message_user(request, err, messages.ERROR)
else:
self.message_user(
request,