Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/update to sqlalchemy1.4 #86

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions backend/gn_module_zh/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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:
Expand Down
Loading