mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 01:27:03 +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):
|
def do_delete_domain(self, request, obj):
|
||||||
if not isinstance(obj, Domain):
|
if not isinstance(obj, Domain):
|
||||||
# Could be problematic if the type is similar,
|
# 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.
|
# 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:
|
try:
|
||||||
obj.deletedInEpp()
|
obj.deletedInEpp()
|
||||||
obj.save()
|
obj.save()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue