From da320b42c6253381d44fa06ab1c5f34601c30bed Mon Sep 17 00:00:00 2001 From: phear Date: Wed, 14 Dec 2005 19:01:05 +0000 Subject: [PATCH] the last bugfix did not work --- database.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/database.py b/database.py index d9cc966..d5ed7df 100644 --- a/database.py +++ b/database.py @@ -105,17 +105,17 @@ class Users(SQLObject): def remove_game(self,gamename): """removes a game whose name is given.""" - gamename = int(gamename) #sqlobject does a int(value) for self.game[1..10] - if self.game1 == gamename: self.game1=None - if self.game2 == gamename: self.game2=None - if self.game3 == gamename: self.game3=None - if self.game4 == gamename: self.game4=None - if self.game5 == gamename: self.game5=None - if self.game6 == gamename: self.game6=None - if self.game7 == gamename: self.game7=None - if self.game8 == gamename: self.game8=None - if self.game9 == gamename: self.game9=None - if self.game10 == gamename: self.game10=None + gamenames = (int(gamename),str(gamename),gamename) + if self.game1 in gamenames : self.game1=None + if self.game2 in gamenames : self.game2=None + if self.game3 in gamenames : self.game3=None + if self.game4 in gamenames : self.game4=None + if self.game5 in gamenames : self.game5=None + if self.game6 in gamenames : self.game6=None + if self.game7 in gamenames : self.game7=None + if self.game8 in gamenames : self.game8=None + if self.game9 in gamenames : self.game9=None + if self.game10 in gamenames : self.game10=None def free_slot_left(self): """Returns True, if there is an empty game slot left, else returns False."""