From 83fe4b7c03d16d78aef1b381768c11c0b6f67ed5 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 30 Oct 2011 18:45:07 -0400 Subject: [PATCH] Fix untrack_page() - I guess you can't parameterize column names. --- bot/tasks/afc_statistics.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bot/tasks/afc_statistics.py b/bot/tasks/afc_statistics.py index e183284..d5c7886 100644 --- a/bot/tasks/afc_statistics.py +++ b/bot/tasks/afc_statistics.py @@ -232,12 +232,13 @@ class Task(BaseTask): self.track_page(cursor, page) def untrack_page(self, cursor, pageid=None, title=None): - query = """DELETE FROM page, row USING page JOIN row - ON page_id = row_id WHERE ? = ?""" + query = "DELETE FROM page, row USING page JOIN row ON page_id = row_id WHERE " if pageid: - cursor.execute(query, ("page_id", pageid)) + query += "page_id = ?" + cursor.execute(query, (pageid,)) elif title: - cursor.execute(query, ("page_title", title)) + query += "page_title = ?" + cursor.execute(query, (title,)) def track_page(self, cursor, title): """Update hook for when page is not in our database."""