mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-20 23:41:20 +00:00
Use handle_view_exception
This commit is contained in:
parent
ce913f92eb
commit
102640f14d
1 changed files with 2 additions and 3 deletions
|
@ -134,12 +134,11 @@ class CustomModelView(ModelView):
|
||||||
model = self.customCreateModel(form)
|
model = self.customCreateModel(form)
|
||||||
|
|
||||||
self.session.add(model)
|
self.session.add(model)
|
||||||
|
|
||||||
self.on_model_change(form, model, True)
|
self.on_model_change(form, model, True)
|
||||||
|
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
flash(str(ex), "error")
|
if not self.handle_view_exception(ex):
|
||||||
|
flash(str(ex), "error")
|
||||||
|
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue