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()
pull/253/head
Mike Lang 3 years ago
parent b1b8ef8973
commit 101468cbca

@ -185,9 +185,9 @@ class Cutter(object):
# Any successful claim will clear its error. # Any successful claim will clear its error.
result = query(self.conn, """ result = query(self.conn, """
UPDATE events UPDATE events
SET error = %s SET error = %(error)s
WHERE id = %s AND state = 'EDITED' AND error IS NULL WHERE id = %(id)s AND state = 'EDITED' AND error IS NULL
""", candidate.id, error) """, id=candidate.id, error=error)
except Exception: except Exception:
self.logger.exception("Failed to set error for candidate {}, ignoring".format(format_job(candidate))) self.logger.exception("Failed to set error for candidate {}, ignoring".format(format_job(candidate)))
self.refresh_conn() self.refresh_conn()

Loading…
Cancel
Save