Changeset 1081

Show
Ignore:
Timestamp:
07/11/03 16:23:13 (21 years ago)
Author:
jalet
Message:

When adding an user only adds one object containing both the user and
its account balance instead of two objects.

Files:
1 modified

Legend:

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

    r1075 r1081  
    2121# 
    2222# $Log$ 
     23# Revision 1.18  2003/07/11 14:23:13  jalet 
     24# When adding an user only adds one object containing both the user and 
     25# its account balance instead of two objects. 
     26# 
    2327# Revision 1.17  2003/07/07 12:51:07  jalet 
    2428# Small fix 
     
    457461        """Adds a user to the quota storage, returns it.""" 
    458462        fields = { self.info["userrdn"] : user.Name, 
    459                    "objectClass" : ["pykotaObject", "pykotaAccount"], 
     463                   "objectClass" : ["pykotaObject", "pykotaAccount", "pykotaAccountBalance"], 
    460464                   "cn" : user.Name, 
    461465                   "pykotaUserName" : user.Name, 
    462466                   "pykotaLimitBY" : (user.LimitBy or "quota"), 
    463                  }  
    464         dn = "%s=%s,%s" % (self.info["userrdn"], user.Name, self.info["userbase"]) 
    465         self.doAdd(dn, fields) 
    466         fields = {  
    467                    "objectClass" : ["pykotaObject", "pykotaAccountBalance"], 
    468                    "cn" : user.Name, 
    469                    "pykotaUserName" : user.Name, 
    470467                   "pykotaBalance" : str(user.AccountBalance or 0.0), 
    471468                   "pykotaLifeTimePaid" : str(user.LifeTimePaid or 0.0), 
    472469                 }  
    473         dn = "cn=%s,%s" % (user.Name, self.info["balancebase"]) 
     470        dn = "%s=%s,%s" % (self.info["userrdn"], user.Name, self.info["userbase"]) 
    474471        self.doAdd(dn, fields) 
    475472        return self.getUser(user.Name)