Commit 38f22da2 authored by PJ Janse van Rensburg's avatar PJ Janse van Rensburg

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

parents 5503ee5f 45617b91
...@@ -1081,7 +1081,10 @@ class ModelView(BaseModelView): ...@@ -1081,7 +1081,10 @@ class ModelView(BaseModelView):
# Error handler # Error handler
def handle_view_exception(self, exc): def handle_view_exception(self, exc):
if isinstance(exc, IntegrityError): 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 raise
else: else:
flash(gettext('Integrity error. %(message)s', message=text_type(exc)), 'error') 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