Changeset 13200 for main


Ignore:
Timestamp:
15 Aug 2015, 20:20:15 (9 years ago)
Author:
Henrik Bettermann
Message:

Add the same restrictions to student data exporters.

File:
1 edited

Legend:

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

    r13198 r13200  
    3838    NullValidator, jsaction, action, UtilityView)
    3939from waeup.kofa.browser.breadcrumbs import Breadcrumb
    40 from waeup.kofa.browser.pages import ContactAdminFormPage, ExportCSVView, doll_up
     40from waeup.kofa.browser.pages import (
     41    ContactAdminFormPage, ExportCSVView, doll_up, running_jobs)
    4142from waeup.kofa.browser.interfaces import ICaptchaManager
    4243from waeup.kofa.hostels.hostel import NOT_OCCUPIED
     
    32453246                "system load. Please try again later."), type='danger')
    32463247            return
     3248        if running_jobs(self):
     3249            self.flash(_(
     3250                "Sorry, another export job is running. "
     3251                "Please try again later."), type='danger')
     3252            self.entries = doll_up(self, user=None)
     3253            return
    32473254        if payments_start or payments_end:
    32483255            date_format = '%d/%m/%Y'
     
    33403347            return
    33413348        utils = queryUtility(IKofaUtils)
     3349        if utils.export_disabled_message():
     3350            self.flash(utils.export_disabled_message(), type='danger')
     3351            self.entries = doll_up(self, user=None)
     3352            return
    33423353        if not utils.expensive_actions_allowed():
    33433354            self.flash(_(
    33443355                "Currently, exporters cannot be started due to high "
    33453356                "system load. Please try again later."), type='danger')
     3357            return
     3358        if running_jobs(self):
     3359            self.flash(_(
     3360                "Sorry, another export job is running. "
     3361                "Please try again later."), type='danger')
     3362            self.entries = doll_up(self, user=None)
    33463363            return
    33473364        try:
     
    34263443            return
    34273444        utils = queryUtility(IKofaUtils)
     3445        if utils.export_disabled_message():
     3446            self.flash(utils.export_disabled_message(), type='danger')
     3447            self.entries = doll_up(self, user=None)
     3448            return
    34283449        if not utils.expensive_actions_allowed():
    34293450            self.flash(_(
    34303451                "Currently, exporters cannot be started due to high "
    34313452                "system load. Please try again later."), type='danger')
     3453            return
     3454        if running_jobs(self):
     3455            self.flash(_(
     3456                "Sorry, another export job is running. "
     3457                "Please try again later."), type='danger')
     3458            self.entries = doll_up(self, user=None)
    34323459            return
    34333460        if session == 'all':
Note: See TracChangeset for help on using the changeset viewer.