Changeset 784

Show
Ignore:
Timestamp:
02/10/03 09:41:36 (22 years ago)
Author:
jalet
Message:

edpykota's --reset command line option resets the limit date too.

Files:
1 modified

Legend:

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

    r768 r784  
    1515# 
    1616# $Log$ 
     17# Revision 1.17  2003/02/10 08:41:36  jalet 
     18# edpykota's --reset command line option resets the limit date too. 
     19# 
    1720# Revision 1.16  2003/02/08 22:39:46  jalet 
    1821# --reset command line option added 
     
    172175        (userid, printerid) = self.getUPIds(username, printername) 
    173176        if (userid is not None) and (printerid is not None) : 
    174             self.doQuery("UPDATE userpquota SET pagecounter=0 WHERE userid=%s AND printerid=%s;" % (self.doQuote(userid), self.doQuote(printerid))) 
     177            self.doQuery("UPDATE userpquota SET pagecounter=0, datelimit=NULL WHERE userid=%s AND printerid=%s;" % (self.doQuote(userid), self.doQuote(printerid))) 
    175178         
    176179    def setDateLimit(self, username, printername, datelimit) : 
     
    186189            self.doQuery("UPDATE userpquota SET lifepagecounter=lifepagecounter+(%s), pagecounter=pagecounter+(%s) WHERE userid=%s AND printerid=%s;" % (self.doQuote(pagecount), self.doQuote(pagecount), self.doQuote(userid), self.doQuote(printerid))) 
    187190         
    188     def buyUserPQuota(self, username, printername, pagebought) : 
    189         """Buys pages for a given (username, printername).""" 
    190         self.updateUserPQuota(username, printername, -pagebought) 
    191