Fix tweet toggler

This commit is contained in:
Klaus-Uwe Mitterer 2017-02-10 19:16:26 +01:00
parent 74239a16b8
commit eb45d2b0cd

View file

@ -90,7 +90,7 @@ class dbObject:
try: try:
self.executeQuery("SELECT tweet FROM tokens WHERE cid = %i;" % int(cid)) self.executeQuery("SELECT tweet FROM tokens WHERE cid = %i;" % int(cid))
return True if self.cur.fetchone()[0] == 1 else False return True if int(self.cur.fetchone()[0]) == 1 else False
except: except:
raise ValueError("No such user: %i" % int(cid)) raise ValueError("No such user: %i" % int(cid))
@ -99,7 +99,7 @@ class dbObject:
self.executeQuery("UPDATE tokens SET tweet = NOT tweet WHERE cid = %i;" % int(cid)) self.executeQuery("UPDATE tokens SET tweet = NOT tweet WHERE cid = %i;" % int(cid))
self.commit() self.commit()
return getTStatus return self.getTStatus(cid)
def addFish(self, cid): def addFish(self, cid):
self.executeQuery("UPDATE tokens SET fish = fish + 1 WHERE cid = %i;" % int(cid)) self.executeQuery("UPDATE tokens SET fish = fish + 1 WHERE cid = %i;" % int(cid))