Changeset 1711

Show
Ignore:
Timestamp:
09/10/04 23:32:54 (20 years ago)
Author:
jalet
Message:

Small fixes for incomplete entry intialization

Location:
pykota/trunk/pykota
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storage.py

    r1692 r1711  
    2222# 
    2323# $Log$ 
     24# Revision 1.59  2004/09/10 21:32:52  jalet 
     25# Small fixes for incomplete entry intialization 
     26# 
    2427# Revision 1.58  2004/09/02 10:09:30  jalet 
    2528# Fixed bug in LDAP user deletion code which didn't correctly delete the user's 
     
    356359        """Sets the printer's prices.""" 
    357360        if priceperpage is None : 
    358             priceperpage = self.PricePerPage 
     361            priceperpage = self.PricePerPage or 0.0 
    359362        else :     
    360363            self.PricePerPage = float(priceperpage) 
    361364        if priceperjob is None :     
    362             priceperjob = self.PricePerJob 
     365            priceperjob = self.PricePerJob or 0.0 
    363366        else :     
    364367            self.PricePerJob = float(priceperjob) 
  • pykota/trunk/pykota/storages/sql.py

    r1582 r1711  
    2222# 
    2323# $Log$ 
     24# Revision 1.44  2004/09/10 21:32:54  jalet 
     25# Small fixes for incomplete entry intialization 
     26# 
    2427# Revision 1.43  2004/07/01 17:45:49  jalet 
    2528# Added code to handle the description field for printers 
     
    286289    def addUser(self, user) :         
    287290        """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))) 
    289292        return self.getUser(user.Name) 
    290293         
    291294    def addGroup(self, group) :         
    292295        """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"))) 
    294297        return self.getGroup(group.Name) 
    295298