From de4feb5f1b000a07ea116a44f58f4ebe08faf4ea Mon Sep 17 00:00:00 2001
From: Bjarke Madsen <bjarke@nordu.net>
Date: Tue, 21 Mar 2023 13:32:43 +0100
Subject: [PATCH] make publisher 2022 compatible with updated sqlalchemy

---
 compendium_v2/publishers/survey_publisher_2022.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/compendium_v2/publishers/survey_publisher_2022.py b/compendium_v2/publishers/survey_publisher_2022.py
index 03bdbfa2..cb5f9ee8 100644
--- a/compendium_v2/publishers/survey_publisher_2022.py
+++ b/compendium_v2/publishers/survey_publisher_2022.py
@@ -63,8 +63,8 @@ def transfer_budget():
     with db.session_scope() as session, survey_db.session_scope() as survey:
         rows = survey.execute(text(BUDGET_QUERY))
         for row in rows:
-            nren = row['nren']
-            _budget = row['budget']
+            nren = row[0]
+            _budget = row[1]
             try:
                 budget = float(_budget.replace('"', '').replace(',', ''))
             except ValueError:
@@ -94,9 +94,9 @@ def transfer_funding_sources():
             data = survey.execute(
                 text(FUNDING_SOURCES_TEMPLATE_QUERY.format(source.value)))
             for row in data:
-                nren = row['nren']
+                nren = row[0]
                 nrens.add(nren)
-                _value = row['value']
+                _value = row[1]
                 try:
                     value = float(_value.replace('"', '').replace(',', ''))
                 except ValueError:
-- 
GitLab