Changeset 1361 for pykota

Show
Ignore:
Timestamp:
02/25/04 17:52:39 (21 years ago)
Author:
jalet
Message:

Small fix wrt empty user groups

Files:
1 modified

Legend:

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

    r1358 r1361  
    2222# 
    2323# $Log$ 
     24# Revision 1.56  2004/02/25 16:52:39  jalet 
     25# Small fix wrt empty user groups 
     26# 
    2427# Revision 1.55  2004/02/23 22:53:21  jalet 
    2528# Don't retrieve data when it's not needed, to avoid database queries 
     
    539542                grouppquota.LifePageCounter = 0 
    540543                usernamesfilter = "".join(["(pykotaUserName=%s)" % member.Name for member in self.getGroupMembers(group)]) 
    541                 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaPrinterName=%s)(|%s))" % (printer.Name, usernamesfilter), ["pykotaPageCounter", "pykotaLifePageCounter"], base=self.info["userquotabase"]) 
     544                if usernamesfilter : 
     545                    usernamesfilter = "(|%s)" % usernamesfilter 
     546                result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaPrinterName=%s)%s)" % (printer.Name, usernamesfilter), ["pykotaPageCounter", "pykotaLifePageCounter"], base=self.info["userquotabase"]) 
    542547                if result : 
    543548                    for userpquota in result :