mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-15 17:17:02 +02:00
Message instead of value err
This commit is contained in:
parent
f2184e5c37
commit
cf0b342bbb
1 changed files with 6 additions and 2 deletions
|
@ -721,9 +721,13 @@ class DomainAdmin(ListHeaderAdmin):
|
|||
def do_delete_domain(self, request, obj):
|
||||
if not isinstance(obj, Domain):
|
||||
# Could be problematic if the type is similar,
|
||||
# but not the same (same field/func names) so we err out.
|
||||
# but not the same (same field/func names).
|
||||
# We do not want to accidentally delete records.
|
||||
raise ValueError("Object is not of type Domain")
|
||||
self.message_user(
|
||||
request, "Object is not of type Domain", messages.ERROR
|
||||
)
|
||||
return
|
||||
|
||||
try:
|
||||
obj.deletedInEpp()
|
||||
obj.save()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue