def process_exception(self, request, exception):
if isinstance(exception, ProtectedError):
messages.error(
request,
_(
"The object you are trying to delete is used somewhere. Please remove any usages and try again!."
),
)
return HttpResponseRedirect(request.path)
return None