Changeset 9610


Ignore:
Timestamp:
10 Nov 2012, 08:25:17 (12 years ago)
Author:
Henrik Bettermann
Message:

Limit number of files in data center.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/browser
Files:
2 edited

Legend:

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

    r9592 r9610  
    832832    label = _(u'Data Center')
    833833    pnav = 0
    834     max_files = 10
    835834
    836835    def update(self):
    837836        datatable.need()
    838837        warning.need()
    839         self.max_exceeded = False
    840         number_of_pendings = len(self.context.getPendingFiles())
    841         if number_of_pendings > self.max_files:
    842             self.max_exceeded = True
    843838        return super(DatacenterPage, self).update()
    844839
     
    887882    label = _(u'Upload portal data as CSV file')
    888883    pnav = 0
     884    max_files = 10
    889885    upload_button =_(u'Upload')
    890886    cancel_button =_(u'Cancel')
     
    965961    def update(self, uploadfile=None, import_mode=None,
    966962               importer=None, CANCEL=None, SUBMIT=None):
     963        number_of_pendings = len(self.context.getPendingFiles())
     964        if number_of_pendings > self.max_files:
     965            self.flash(
     966                _('Maximum number of files in the data center exceeded.'))
     967            self.redirect(self.url(self.context))
     968            return
    967969        if CANCEL is not None:
    968970            self.redirect(self.url(self.context))
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenterpage.pt

    r9592 r9610  
    1 <p class="alert-message warning" i18n:translate=""
    2   tal:condition="view/max_exceeded">
    3   <strong>NOTICE:</strong>
    4   There are more than
    5   <span tal:content="view/max_files" i18n:name="count">50</span>
    6   pending files in the data center. Please repair them first before uploading
    7   new files. Download and edit their records according to the error
    8   messages in the last column.
    9   Do not change file names when re-uploading files.
    10   If a file contains no more data for import just remove it.
    11 </p>
    12 
    131<p  i18n:domain="waeup.kofa" i18n:translate="">
    142The data center helps you to manage portal data. You can upload CSV
Note: See TracChangeset for help on using the changeset viewer.