From eb45d2b0cd4115fdb217c1b5d2b00dee8c008ff9 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Fri, 10 Feb 2017 19:16:26 +0100 Subject: [PATCH] Fix tweet toggler --- dbtools/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbtools/__init__.py b/dbtools/__init__.py index 5b006ef..32027ee 100644 --- a/dbtools/__init__.py +++ b/dbtools/__init__.py @@ -90,7 +90,7 @@ class dbObject: try: 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: 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.commit() - return getTStatus + return self.getTStatus(cid) def addFish(self, cid): self.executeQuery("UPDATE tokens SET fish = fish + 1 WHERE cid = %i;" % int(cid))