Changeset 1711
- Timestamp:
- 09/10/04 23:32:54 (20 years ago)
- Location:
- pykota/trunk/pykota
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storage.py
r1692 r1711 22 22 # 23 23 # $Log$ 24 # Revision 1.59 2004/09/10 21:32:52 jalet 25 # Small fixes for incomplete entry intialization 26 # 24 27 # Revision 1.58 2004/09/02 10:09:30 jalet 25 28 # Fixed bug in LDAP user deletion code which didn't correctly delete the user's … … 356 359 """Sets the printer's prices.""" 357 360 if priceperpage is None : 358 priceperpage = self.PricePerPage 361 priceperpage = self.PricePerPage or 0.0 359 362 else : 360 363 self.PricePerPage = float(priceperpage) 361 364 if priceperjob is None : 362 priceperjob = self.PricePerJob 365 priceperjob = self.PricePerJob or 0.0 363 366 else : 364 367 self.PricePerJob = float(priceperjob) -
pykota/trunk/pykota/storages/sql.py
r1582 r1711 22 22 # 23 23 # $Log$ 24 # Revision 1.44 2004/09/10 21:32:54 jalet 25 # Small fixes for incomplete entry intialization 26 # 24 27 # Revision 1.43 2004/07/01 17:45:49 jalet 25 28 # Added code to handle the description field for printers … … 286 289 def addUser(self, user) : 287 290 """Adds a user to the quota storage, returns its id.""" 288 self.doModify("INSERT INTO users (username, limitby, balance, lifetimepaid, email) VALUES (%s, %s, %s, %s, %s)" % (self.doQuote(user.Name), self.doQuote(user.LimitBy ), self.doQuote(user.AccountBalance), self.doQuote(user.LifeTimePaid), self.doQuote(user.Email)))291 self.doModify("INSERT INTO users (username, limitby, balance, lifetimepaid, email) VALUES (%s, %s, %s, %s, %s)" % (self.doQuote(user.Name), self.doQuote(user.LimitBy or 'quota'), self.doQuote(user.AccountBalance or 0.0), self.doQuote(user.LifeTimePaid or 0.0), self.doQuote(user.Email))) 289 292 return self.getUser(user.Name) 290 293 291 294 def addGroup(self, group) : 292 295 """Adds a group to the quota storage, returns its id.""" 293 self.doModify("INSERT INTO groups (groupname, limitby) VALUES (%s, %s)" % (self.doQuote(group.Name), self.doQuote(group.LimitBy )))296 self.doModify("INSERT INTO groups (groupname, limitby) VALUES (%s, %s)" % (self.doQuote(group.Name), self.doQuote(group.LimitBy or "quota"))) 294 297 return self.getGroup(group.Name) 295 298