Changeset 1062

Show
Ignore:
Timestamp:
07/05/03 09:46:50 (21 years ago)
Author:
jalet
Message:

The previous bug fix was incomplete.

Location:
pykota/trunk
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/NEWS

    r1061 r1062  
    2222PyKota NEWS : 
    2323 
     24    - 1.12alpha2 : 
     25     
     26        - The previous bug fix was incomplete. This is corrected. 
     27         
    2428    - 1.12alpha1 : 
    2529     
  • pykota/trunk/pykota/reporters/text.py

    r1056 r1062  
    2121# 
    2222# $Log$ 
     23# Revision 1.3  2003/07/05 07:46:50  jalet 
     24# The previous bug fix was incomplete. 
     25# 
    2326# Revision 1.2  2003/07/02 09:29:12  jalet 
    2427# Bug fixed when wanting a report and an user/group was limited by account balance 
     
    8487        lifetimepaid = float(entry.LifeTimePaid or 0.0) 
    8588         
    86         if entry.LimitBy.lower() == "balance" :     
     89        if entry.LimitBy and (entry.LimitBy.lower() == "balance") :     
    8790            if balance <= 0 : 
    8891                datelimit = "DENY" 
  • pykota/trunk/pykota/storage.py

    r1043 r1062  
    2121# 
    2222# $Log$ 
     23# Revision 1.17  2003/07/05 07:46:50  jalet 
     24# The previous bug fix was incomplete. 
     25# 
    2326# Revision 1.16  2003/06/25 19:52:31  jalet 
    2427# Should be ready for testing :-) 
     
    124127    def setLimitBy(self, limitby) :     
    125128        """Sets the user's limiting factor.""" 
    126         limitby = limitby.lower() 
     129        try : 
     130            limitby = limitby.lower() 
     131        except AttributeError :     
     132            limitby = "quota" 
    127133        if limitby in ["quota", "balance"] : 
    128134            self.parent.writeUserLimitBy(self, limitby) 
     
    151157    def setLimitBy(self, limitby) :     
    152158        """Sets the user's limiting factor.""" 
    153         limitby = limitby.lower() 
     159        try : 
     160            limitby = limitby.lower() 
     161        except AttributeError :     
     162            limitby = "quota" 
    154163        if limitby in ["quota", "balance"] : 
    155164            self.parent.writeGroupLimitBy(self, limitby) 
  • pykota/trunk/pykota/storages/ldapstorage.py

    r1051 r1062  
    2121# 
    2222# $Log$ 
     23# Revision 1.13  2003/07/05 07:46:50  jalet 
     24# The previous bug fix was incomplete. 
     25# 
    2326# Revision 1.12  2003/06/30 13:54:21  jalet 
    2427# Sorts by user / group name 
     
    188191            fields = result[0][1] 
    189192            user.ident = result[0][0] 
    190             user.LimitBy = fields.get("pykotaLimitBy")[0] 
     193            user.LimitBy = fields.get("pykotaLimitBy") 
     194            if user.LimitBy is not None : 
     195                user.LimitBy = user.LimitBy[0] 
    191196            result = self.doSearch("(&(objectClass=pykotaAccountBalance)(|(pykotaUserName=%s)(%s=%s)))" % (username, self.info["balancerdn"], username), ["pykotaBalance", "pykotaLifeTimePaid"], base=self.info["balancebase"]) 
    192197            if result : 
     
    217222            fields = result[0][1] 
    218223            group.ident = result[0][0] 
    219             group.LimitBy = fields.get("pykotaLimitBy")[0] 
     224            group.LimitBy = fields.get("pykotaLimitBy") 
     225            if group.LimitBy is not None : 
     226                group.LimitBy = group.LimitBy[0] 
    220227            group.AccountBalance = 0.0 
    221228            group.LifeTimePaid = 0.0 
  • pykota/trunk/pykota/version.py

    r1061 r1062  
    2121# 
    2222 
    23 __version__ = "1.12alpha1_unofficial" 
     23__version__ = "1.12alpha2_unofficial" 
    2424 
    2525__doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""