Skip to content

Commit

Permalink
frontend: pagure events: use text() wrapper around raw queries
Browse files Browse the repository at this point in the history
[ERROR coprs] Textual SQL expression 'LOCK TABLE build IN EXCLU...'
should be explicitly declared as text('LOCK TABLE build IN EXCLU...')
  • Loading branch information
praiskup authored and nikromen committed Dec 9, 2024
1 parent ed088ee commit 48e7b43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/coprs_frontend/pagure_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)))
)
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 48e7b43

Please sign in to comment.