mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-20 23:41:20 +00:00
Check returned bool from customUpdateModel
This commit is contained in:
parent
34c9b3318d
commit
4d9a72431d
1 changed files with 8 additions and 1 deletions
|
@ -159,11 +159,18 @@ class CustomModelView(ModelView):
|
|||
return model
|
||||
|
||||
def customUpdateModel(self, form, model):
|
||||
"""
|
||||
Retrun True if something changed during update, False otherwise.
|
||||
"""
|
||||
form.populate_obj(model)
|
||||
# No way to know if something changed. Therefore, return True anyway.
|
||||
return True
|
||||
|
||||
def update_model(self, form, model):
|
||||
try:
|
||||
self.customUpdateModel(form, model)
|
||||
if self.customUpdateModel(form, model) is False:
|
||||
# Nothing changed
|
||||
return True
|
||||
|
||||
self.on_model_change(form, model, False)
|
||||
self.session.commit()
|
||||
|
|
Loading…
Reference in a new issue