Changeset 1068 for pykota/trunk/pykota/storages
- Timestamp:
- 07/07/03 13:49:24 (21 years ago)
- Location:
- pykota/trunk/pykota/storages
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/ldapstorage.py
r1067 r1068 21 21 # 22 22 # $Log$ 23 # Revision 1.15 2003/07/07 11:49:24 jalet 24 # Lots of small fixes with the help of PyChecker 25 # 23 26 # Revision 1.14 2003/07/07 08:33:18 jalet 24 27 # Bug fix due to a typo in LDAP code … … 425 428 for (groupquotaid, fields) in result : 426 429 group = self.getGroup(fields.get("pykotaGroupName")[0]) 427 if (names is None) or self.tool.matchString( user.Name, names) :430 if (names is None) or self.tool.matchString(group.Name, names) : 428 431 grouppquota = self.getGroupPQuota(group, printer) 429 432 groupsandquotas.append((group, grouppquota)) -
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 :