1
0
Fork 0
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:
Mo 2022-05-15 19:07:08 +02:00
parent ce913f92eb
commit 102640f14d

View file

@ -134,11 +134,10 @@ class CustomModelView(ModelView):
model = self.customCreateModel(form)
self.session.add(model)
self.on_model_change(form, model, True)
self.session.commit()
except Exception as ex:
if not self.handle_view_exception(ex):
flash(str(ex), "error")
self.session.rollback()