From 101468cbca599a0cb2d95c6867870a2b012045e4 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Sun, 14 Nov 2021 07:54:36 +1100 Subject: [PATCH] Fix a bug when reporting errors claiming candidates The SQL args were the wrong way around, so we tried to set error to the id. Thankfully this failed as the id queried is not a valid uuid. Fix by making args named like every other usage of query() --- cutter/cutter/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cutter/cutter/main.py b/cutter/cutter/main.py index fb6dd58..2a9087f 100644 --- a/cutter/cutter/main.py +++ b/cutter/cutter/main.py @@ -185,9 +185,9 @@ class Cutter(object): # Any successful claim will clear its error. result = query(self.conn, """ UPDATE events - SET error = %s - WHERE id = %s AND state = 'EDITED' AND error IS NULL - """, candidate.id, error) + SET error = %(error)s + WHERE id = %(id)s AND state = 'EDITED' AND error IS NULL + """, id=candidate.id, error=error) except Exception: self.logger.exception("Failed to set error for candidate {}, ignoring".format(format_job(candidate))) self.refresh_conn()