Changeset 13426 for main


Ignore:
Timestamp:
10 Nov 2015, 06:44:30 (9 years ago)
Author:
Henrik Bettermann
Message:

Only forbid import step 4 if maintenance is not enabled.

Do not create hostel ids with dots.

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

Legend:

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

    r13396 r13426  
    13741374
    13751375    def update(self, filename=None, select=None, cancel=None):
    1376         if not grok.getSite()['configuration'].maintmode_enabled_by and \
    1377             not self.request.principal.id == 'admin':
     1376        if not grok.getSite()['configuration'].maintmode_enabled_by:
    13781377            self.flash(
    13791378                _('Portal must be in maintenance mode for data import.'),
    13801379                type='warning')
    1381             self.redirect(self.url(self.context))
    1382             return
    13831380        if cancel is not None:
    13841381            self.redirect(self.url(self.context))
     
    16271624
    16281625    def update(self, back=None, finish=None, showlog=None):
     1626        if not grok.getSite()['configuration'].maintmode_enabled_by and \
     1627            not self.request.principal.id == 'admin':
     1628            self.flash(
     1629                _('File has not been imported. '
     1630                  'Portal must be in maintenance mode for data import.'),
     1631                type='danger')
     1632            self.redirect(self.url(self.context))
     1633            return
    16291634        if finish is not None:
    16301635            self.redirect(self.url(self.context, '@@import1'))
  • main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py

    r13346 r13426  
    204204        hostel = Hostel()
    205205        self.applyData(hostel, **data)
    206         hostel.hostel_id = data[
    207             'hostel_name'].lower().replace(' ','-').replace('_','-')
     206        hostel.hostel_id = data['hostel_name'].lower().replace(
     207            ' ','-').replace('_','-').replace('.','')
    208208        try:
    209209            self.context.addHostel(hostel)
Note: See TracChangeset for help on using the changeset viewer.