Commit 45617b91 authored by PJ Janse van Rensburg's avatar PJ Janse van Rensburg

Merge branch 'raise-on-integrity-error-exception' of...

Merge branch 'raise-on-integrity-error-exception' of https://github.com/jmagnusson/flask-admin into raise-on-integrity-error-exception
parents d998450b 645fbbd2
......@@ -1081,7 +1081,10 @@ class ModelView(BaseModelView):
# Error handler
def handle_view_exception(self, exc):
if isinstance(exc, IntegrityError):
if current_app.config.get('ADMIN_RAISE_ON_VIEW_EXCEPTION'):
if current_app.config.get(
'ADMIN_RAISE_ON_INTEGRITY_ERROR',
current_app.config.get('ADMIN_RAISE_ON_VIEW_EXCEPTION')
):
raise
else:
flash(gettext('Integrity error. %(message)s', message=text_type(exc)), 'error')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment