Changeset 1068 for pykota/trunk/pykota/storages/pgstorage.py
- Timestamp:
- 07/07/03 13:49:24 (21 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/pgstorage.py
r1067 r1068 21 21 # 22 22 # $Log$ 23 # Revision 1.6 2003/07/07 11:49:24 jalet 24 # Lots of small fixes with the help of PyChecker 25 # 23 26 # Revision 1.5 2003/07/07 08:33:19 jalet 24 27 # Bug fix due to a typo in LDAP code … … 126 129 except pg.error, msg : 127 130 raise PyKotaStorageError, msg 131 else : 132 return result 128 133 129 134 def doQuote(self, field) : … … 329 334 def addUserToGroup(self, user, group) : 330 335 """Adds an user to a group.""" 331 result = self.do Modify("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))) 332 337 try : 333 mexists = self.doParseResult(result)[0]["mexists"]334 except TypeError:338 mexists = int(result[0].get("mexists")) 339 except (IndexError, TypeError) : 335 340 mexists = 0 336 341 if not mexists :