def save_model(self, request, obj, form, change):
    try:
        obj.save()
    except Exception as exc:
        self.message_user(request, ('Save failed: %s' % str(exc)), level=messages.ERROR)
        raise ValidationError(str(exc))
def save_model(self, request, obj, form, change):
    try:
        obj.save()
    except Exception as exc:
        self.message_user(request, ('Save failed: %s' % str(exc)), level=messages.ERROR)
        raise ValidationError(str(exc))