Changeset 2287 for pykota

Show
Ignore:
Timestamp:
06/08/05 09:19:43 (19 years ago)
Author:
jerome
Message:

Now stores 'hidden' in the title, filename and options fields instead of the
sentence "Hidden because of privacy concerns". When the history is retrieved,
'hidden' is automatically transformed into this sentence, translated into
the final user's preferred language. This effectively delays the translation
until the message is needed, and allows the database to be consitent when
different users with different locales use the system.

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

Legend:

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

    r2276 r2287  
    541541                lastjob.JobMD5Sum = fields.get("pykotaMD5Sum", [None])[0] 
    542542                lastjob.JobPages = fields.get("pykotaPages", [""])[0] 
     543                if lastjob.JobTitle == lastjob.JobFileName == lastjob.JobOptions == "hidden" : 
     544                    (lastjob.JobTitle, lastjob.JobFileName, lastjob.JobOptions) = (_("Hidden because of privacy concerns"),) * 3 
    543545                date = fields.get("createTimestamp", ["19700101000000"])[0] 
    544546                year = int(date[:4]) 
     
    946948        if self.privacy :     
    947949            # For legal reasons, we want to hide the title, filename and options 
    948             title = filename = options = _("Hidden because of privacy concerns") 
     950            title = filename = options = "hidden" 
    949951        fields = { 
    950952                   "objectClass" : ["pykotaObject", "pykotaJob"], 
     
    11031105                job.JobMD5Sum = fields.get("pykotaMD5Sum", [None])[0] 
    11041106                job.JobPages = fields.get("pykotaPages", [""])[0] 
     1107                if job.JobTitle == job.JobFileName == job.JobOptions == "hidden" : 
     1108                    (job.JobTitle, job.JobFileName, job.JobOptions) = (_("Hidden because of privacy concerns"),) * 3 
    11051109                date = fields.get("createTimestamp", ["19700101000000"])[0] 
    11061110                year = int(date[:4]) 
  • pykota/trunk/pykota/storages/sql.py

    r2266 r2287  
    266266            lastjob.JobPages = fields.get("pages") 
    267267            lastjob.JobBillingCode = self.databaseToUserCharset(fields.get("billingcode")) 
     268            if lastjob.JobTitle == lastjob.JobFileName == lastjob.JobOptions == "hidden" : 
     269                (lastjob.JobTitle, lastjob.JobFileName, lastjob.JobOptions) = (_("Hidden because of privacy concerns"),) * 3 
    268270            lastjob.Exists = 1 
    269271        return lastjob 
     
    464466        if self.privacy :     
    465467            # For legal reasons, we want to hide the title, filename and options 
    466             title = filename = options = _("Hidden because of privacy concerns") 
     468            title = filename = options = "hidden" 
    467469        filename = self.userCharsetToDatabase(filename) 
    468470        title = self.userCharsetToDatabase(title) 
     
    552554                job.UserName = fields.get("username") 
    553555                job.PrinterName = fields.get("printername") 
     556                if job.JobTitle == job.JobFileName == job.JobOptions == "hidden" : 
     557                    (job.JobTitle, job.JobFileName, job.JobOptions) = (_("Hidden because of privacy concerns"),) * 3 
    554558                job.Exists = 1 
    555559                jobs.append(job)