From fca9eb72b9d6842813e15fe051926065f96c046d Mon Sep 17 00:00:00 2001 From: Frisk Date: Fri, 7 Aug 2020 23:03:20 +0200 Subject: [PATCH] Prevent setting -1 for rcid and postid to other values when feature disabled --- src/queue_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/queue_handler.py b/src/queue_handler.py index d218d00..4bb9232 100644 --- a/src/queue_handler.py +++ b/src/queue_handler.py @@ -17,7 +17,7 @@ class UpdateDB: def update_db(self): for update in self.updated: update_type = "postid" if update[2] is not None else "rcid" - db_cursor.execute("UPDATE rcgcdw SET {} = ? WHERE wiki = ?".format(update_type), (update[1],update[0],)) + db_cursor.execute("UPDATE rcgcdw SET {} = ? WHERE wiki = ? AND NOT ? = -1".format(update_type), (update[1], update[0], update_type)) db_connection.commit() self.clear_list()