Ignore:
Timestamp:
10 Feb 2015, 14:33:23 (10 years ago)
Author:
uli
Message:

Do not store empty jobs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/reports.py

    r9680 r12583  
    268268        persistent list.
    269269
    270         Returns the job ID of the job started.
     270        Returns the job ID of the job started, `None` if the job could
     271        not be started.
    271272        """
    272273        site = grok.getSite()
     
    274275        job = AsyncReportJob(site, generator_name, args=args, kw=kw)
    275276        job_id = manager.put(job)
    276         # Make sure that the persisted list is stored in ZODB
    277         self.running_report_jobs = PersistentList(self.running_report_jobs)
    278         self.running_report_jobs.append((job_id, generator_name, user_id),)
     277        if job_id is not None:
     278            # Make sure that the persisted list is stored in ZODB
     279            self.running_report_jobs = PersistentList(self.running_report_jobs)
     280            self.running_report_jobs.append((job_id, generator_name, user_id),)
    279281        return job_id
    280282
Note: See TracChangeset for help on using the changeset viewer.