You should be able to catch the exception. When you look at the DeletionMixin
:
https://github.com/django/django/blob/master/django/views/generic/edit.py#L256
You can override the post
method and achieve something like:
def post(self, request, *args, **kwargs):
try:
return self.delete(request, *args, **kwargs)
except ProtectedError:
# render the template with your message in the context
# or you can use the messages framework to send the message
Hope this helps.