From 9d35d000cf303d87ce3214541fe9c7da232f2eda Mon Sep 17 00:00:00 2001 From: Vincent Bourgeois Date: Tue, 3 Sep 2024 16:50:03 +0200 Subject: [PATCH] fix: update to sqlalchemy 1.4 --- backend/gn_module_zh/forms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/gn_module_zh/forms.py b/backend/gn_module_zh/forms.py index a4970e62..e9cfd8be 100644 --- a/backend/gn_module_zh/forms.py +++ b/backend/gn_module_zh/forms.py @@ -604,7 +604,7 @@ def post_outflow(id_zh, outflows): def update_inflow(id_zh, inflows): try: - DB.session.execute(select(TInflow).where(TInflow.id_zh == id_zh)) + DB.session.execute(delete(TInflow).where(TInflow.id_zh == id_zh)) post_inflow(id_zh, inflows) except Exception as e: if e.__class__.__name__ == "DataError": @@ -820,7 +820,7 @@ def post_instruments(id_zh, instruments): def update_protections(id_zh, protections): try: - DB.session.execute(select(CorZhProtection).where(CorZhProtection.id_zh == id_zh)) + DB.session.execute(delete(CorZhProtection).where(CorZhProtection.id_zh == id_zh)) post_protections(id_zh, protections) except Exception as e: if e.__class__.__name__ == "DataError": @@ -928,7 +928,7 @@ def post_urban_docs(id_zh, urban_docs): def update_actions(id_zh, actions): try: # delete cascade actions - DB.session.execute(select(TActions).where(TActions.id_zh == id_zh)) + DB.session.execute(delete(TActions).where(TActions.id_zh == id_zh)) # post new actions post_actions(id_zh, actions) except Exception as e: