From b338e11f4dacf03d80f4648cbae185046d27643d Mon Sep 17 00:00:00 2001 From: Aditi Anand Date: Wed, 20 Mar 2024 11:19:25 -0400 Subject: [PATCH] sqlalchemy2.0 fix --- app/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/commands.py b/app/commands.py index f56439d1d..d2777379b 100644 --- a/app/commands.py +++ b/app/commands.py @@ -608,7 +608,7 @@ def populate_annual_billing_with_the_previous_years_allowance(year): from annual_billing where financial_year_start = :year """ - services_without_annual_billing = db.session.execute(sql, {"year": year}) + services_without_annual_billing = db.session.execute(text(sql), {"year": year}) for row in services_without_annual_billing: latest_annual_billing = """ Select free_sms_fragment_limit @@ -617,7 +617,7 @@ def populate_annual_billing_with_the_previous_years_allowance(year): order by financial_year_start desc limit 1 """ free_allowance_rows = db.session.execute( - latest_annual_billing, {"service_id": row.id} + text(latest_annual_billing), {"service_id": row.id} ) free_allowance = [x[0] for x in free_allowance_rows] print(f"create free limit of {free_allowance[0]} for service: {row.id}")