Changeset 2718

Show
Ignore:
Timestamp:
02/20/06 22:29:28 (19 years ago)
Author:
jerome
Message:

Fixed deletion code for print quota entries.

Location:
pykota/trunk/pykota/storages
Files:
2 modified

Legend:

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

    r2717 r2718  
    14141414        for (ident, fields) in result : 
    14151415            self.doDelete(ident) 
     1416        if upquota.Printer.LastJob.UserName == upquota.User.Name : 
     1417            self.doDelete(upquota.Printer.LastJob.lastjobident) 
    14161418        self.doDelete(upquota.ident) 
    14171419         
  • pykota/trunk/pykota/storages/sql.py

    r2717 r2718  
    745745        """Completely deletes an user print quota entry from the database.""" 
    746746        for q in [  
    747                     "DELETE FROM jobhistory WHERE userid=%s" % self.doQuote(upquota.User.ident), 
    748                     "DELETE FROM userpquota WHERE userid=%s" % self.doQuote(upquota.ident), 
     747                    "DELETE FROM jobhistory WHERE userid=%s AND printerid=%s" \ 
     748                                 % (self.doQuote(upquota.User.ident), self.doQuote(upquota.Printer.ident)), 
     749                    "DELETE FROM userpquota WHERE id=%s" % self.doQuote(upquota.ident), 
    749750                  ] : 
    750751            self.doModify(q) 
     
    753754        """Completely deletes a group print quota entry from the database.""" 
    754755        for q in [  
    755                     "DELETE FROM grouppquota WHERE groupid=%s" % self.doQuote(gpquota.ident), 
     756                    "DELETE FROM grouppquota WHERE id=%s" % self.doQuote(gpquota.ident), 
    756757                  ] : 
    757758            self.doModify(q)