diff --git a/src/registrar/admin.py b/src/registrar/admin.py index 5976f0370..a806d7dc7 100644 --- a/src/registrar/admin.py +++ b/src/registrar/admin.py @@ -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()