Show
Ignore:
Timestamp:
07/07/03 13:49:24 (21 years ago)
Author:
jalet
Message:

Lots of small fixes with the help of PyChecker?

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/pgstorage.py

    r1067 r1068  
    2121# 
    2222# $Log$ 
     23# Revision 1.6  2003/07/07 11:49:24  jalet 
     24# Lots of small fixes with the help of PyChecker 
     25# 
    2326# Revision 1.5  2003/07/07 08:33:19  jalet 
    2427# Bug fix due to a typo in LDAP code 
     
    126129        except pg.error, msg :     
    127130            raise PyKotaStorageError, msg 
     131        else :     
     132            return result 
    128133             
    129134    def doQuote(self, field) : 
     
    329334    def addUserToGroup(self, user, group) :     
    330335        """Adds an user to a group.""" 
    331         result = self.doModify("SELECT COUNT(*) AS mexists FROM groupsmembers WHERE groupid=%s AND userid=%s" % (self.doQuote(group.ident), self.doQuote(user.ident))) 
     336        result = self.doSearch("SELECT COUNT(*) AS mexists FROM groupsmembers WHERE groupid=%s AND userid=%s" % (self.doQuote(group.ident), self.doQuote(user.ident))) 
    332337        try : 
    333             mexists = self.doParseResult(result)[0]["mexists"] 
    334         except TypeError :     
     338            mexists = int(result[0].get("mexists")) 
     339        except (IndexError, TypeError) :     
    335340            mexists = 0 
    336341        if not mexists :