From 110ff3189c41d71623f942f413fc42891929bb1a Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Thu, 5 Dec 2024 08:13:15 +0100 Subject: [PATCH] frontend: pagure events: use text() wrapper around raw queries [ERROR coprs] Textual SQL expression 'LOCK TABLE build IN EXCLU...' should be explicitly declared as text('LOCK TABLE build IN EXCLU...') --- frontend/coprs_frontend/pagure_events.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/coprs_frontend/pagure_events.py b/frontend/coprs_frontend/pagure_events.py index 0ca2d2c9d..9ad18768e 100755 --- a/frontend/coprs_frontend/pagure_events.py +++ b/frontend/coprs_frontend/pagure_events.py @@ -9,6 +9,8 @@ import munch import subprocess +from sqlalchemy.sql import text + sys.path.append( os.path.dirname(os.path.dirname(os.path.realpath(__file__))) ) @@ -58,7 +60,7 @@ def build(self, source_dict_update, copr_dir, update_callback, scm_object_type, scm_object_id, scm_object_url, agent_url): if db.engine.url.drivername != 'sqlite': - db.session.execute('LOCK TABLE build IN EXCLUSIVE MODE') + db.session.execute(text('LOCK TABLE build IN EXCLUSIVE MODE')) return BuildsLogic.rebuild_package( self.package, source_dict_update, copr_dir, update_callback,