From cdef6f1c4d28dd25d356ae3432dca0644e3011ad Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 21 Sep 2023 18:21:22 +0200 Subject: [PATCH] fix text query, session not engine --- apolpi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apolpi.py b/apolpi.py index dd2e791..164774b 100644 --- a/apolpi.py +++ b/apolpi.py @@ -6,6 +6,7 @@ from flask import request from flask_sqlalchemy import SQLAlchemy +from sqlalchemy import text global CACHED_RESULT global CACHED_TIME @@ -103,7 +104,7 @@ def _fetch(): - roles = db.engine.execute(QUERY) + roles = db.session.execute(text(QUERY)) out = [] for role in roles: out.append(dict(zip(columns, role)))