- Timestamp:
- 03/31/08 17:20:59 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/ldapstorage.py
r3307 r3363 366 366 user.Description = databaseToUnicode(fields.get("description", [None])[0]) 367 367 user.Email = fields.get(self.info["usermail"], [None])[0] 368 user.LimitBy = fields.get("pykotaLimitBy", ["quota"])[0]368 user.LimitBy = databaseToUnicode(fields.get("pykotaLimitBy", ["quota"])[0]) 369 369 result = self.doSearch("(&(objectClass=pykotaAccountBalance)(|(pykotaUserName=%s)(%s=%s)))" % (username, self.info["balancerdn"], username), ["pykotaBalance", "pykotaLifeTimePaid", "pykotaPayments", "pykotaOverCharge"], base=self.info["balancebase"]) 370 370 if not result : … … 414 414 group.Name = fields.get("pykotaGroupName", [databaseToUnicode(groupname)])[0] 415 415 group.Description = databaseToUnicode(fields.get("description", [None])[0]) 416 group.LimitBy = fields.get("pykotaLimitBy", ["quota"])[0]416 group.LimitBy = databaseToUnicode(fields.get("pykotaLimitBy", ["quota"])[0]) 417 417 group.AccountBalance = 0.0 418 418 group.LifeTimePaid = 0.0 … … 659 659 group.LimitBy = fields.get("pykotaLimitBy") 660 660 if group.LimitBy is not None : 661 group.LimitBy = group.LimitBy[0]661 group.LimitBy = databaseToUnicode(group.LimitBy[0]) 662 662 else : 663 group.LimitBy = "quota"663 group.LimitBy = u"quota" 664 664 group.AccountBalance = 0.0 665 665 group.LifeTimePaid = 0.0 … … 746 746 user.ident = userid 747 747 user.Email = fields.get(self.info["usermail"], [None])[0] 748 user.LimitBy = fields.get("pykotaLimitBy", ["quota"])[0]748 user.LimitBy = databaseToUnicode(fields.get("pykotaLimitBy", ["quota"])[0]) 749 749 user.Description = databaseToUnicode(fields.get("description", [""])[0]) 750 750 uname = unicodeToDatabase(username) … … 812 812 group = StorageGroup(self, groupname) 813 813 group.ident = groupid 814 group.Name = fields.get("pykotaGroupName", [ databaseToUnicode(groupname)])[0]815 group.LimitBy = fields.get("pykotaLimitBy", ["quota"])[0]814 group.Name = fields.get("pykotaGroupName", [groupname])[0] 815 group.LimitBy = databaseToUnicode(fields.get("pykotaLimitBy", ["quota"])[0]) 816 816 group.Description = databaseToUnicode(fields.get("description", [""])[0]) 817 817 group.AccountBalance = 0.0 … … 921 921 newfields = { 922 922 "pykotaUserName" : uname, 923 "pykotaLimitBy" : (user.LimitBy or"quota"),923 "pykotaLimitBy" : unicodeToDatabase(user.LimitBy or u"quota"), 924 924 "description" : unicodeToDatabase(user.Description or ""), 925 925 self.info["usermail"] : user.Email or "", … … 996 996 newfields = { 997 997 "pykotaGroupName" : gname, 998 "pykotaLimitBy" : (group.LimitBy or"quota"),998 "pykotaLimitBy" : unicodeToDatabase(group.LimitBy or u"quota"), 999 999 "description" : unicodeToDatabase(group.Description or "") 1000 1000 } … … 1127 1127 """Saves the user to the database in a single operation.""" 1128 1128 newfields = { 1129 "pykotaLimitBy" : (user.LimitBy or"quota"),1129 "pykotaLimitBy" : unicodeToDatabase(user.LimitBy or u"quota"), 1130 1130 "description" : unicodeToDatabase(user.Description or ""), 1131 1131 self.info["usermail"] : user.Email or "", … … 1142 1142 """Saves the group to the database in a single operation.""" 1143 1143 newfields = { 1144 "pykotaLimitBy" : (group.LimitBy or"quota"),1144 "pykotaLimitBy" : unicodeToDatabase(group.LimitBy or u"quota"), 1145 1145 "description" : unicodeToDatabase(group.Description or ""), 1146 1146 }