Changeset 13199 for main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
- Timestamp:
- 15 Aug 2015, 20:08:02 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r13198 r13199 246 246 entries.append(new_entry) 247 247 return entries 248 249 def running_jobs(view): 250 """True if any job is running. 251 """ 252 job_entries = view.context.get_running_export_jobs() 253 job_manager = getUtility(IJobManager) 254 entries = [] 255 for entry in job_entries: 256 job = job_manager.get(entry[0]) 257 status = job.finished and 'ready' or 'running' 258 status = job.failed and 'FAILED' or status 259 if status == 'running': 260 return True 261 return False 248 262 249 263 def getImporters(context): … … 1752 1766 self.entries = doll_up(self, user=None) 1753 1767 return 1768 if running_jobs(self): 1769 self.flash(_( 1770 "Sorry, another export job is running. " 1771 "Please try again later."), type='danger') 1772 self.entries = doll_up(self, user=None) 1773 return 1754 1774 job_id = self.context.start_export_job( 1755 1775 exporter, self.request.principal.id)
Note: See TracChangeset for help on using the changeset viewer.