From 8c7029eb3ce81e7cee60f8307491510c072738a0 Mon Sep 17 00:00:00 2001
From: Thomas Kluyver <thomas@kluyver.me.uk>
Date: Wed, 24 Feb 2021 15:32:47 +0000
Subject: [PATCH] Fix constant value in SQL INSERT statement

---
 webservice/webservice.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/webservice/webservice.py b/webservice/webservice.py
index 340b58abc..edec25509 100644
--- a/webservice/webservice.py
+++ b/webservice/webservice.py
@@ -430,12 +430,11 @@ async def run_action(job_db, cmd, mode, proposal, run, rid):
             c = job_db.cursor()  # FIXME: asyncio
             rstr = ret.stdout.decode()
 
-            query = "INSERT INTO jobs VALUES ('{rid}', '{jobid}', '{proposal}', '{run}', 'PD', '{now}', '{det}', '{act}')"  # noqa
             for r in rstr.split("\n"):
                 if "Submitted job:" in r:
                     _, jobid = r.split(":")
                     c.execute(
-                        "INSERT INTO jobs VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
+                        "INSERT INTO jobs VALUES (?, ?, ?, ?, ?, 'PD', ?, ?)",
                         (rid, jobid.strip(), proposal, run,
                          datetime.now().isoformat(), cmd[3], cmd[4])
                     )
-- 
GitLab