Prevent setting -1 for rcid and postid to other values when feature disabled

This commit is contained in:
Frisk 2020-08-07 23:03:20 +02:00
parent a3eb577966
commit fca9eb72b9
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC

View file

@ -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()