Ignore:
Timestamp:
6 Aug 2020, 10:49:02 (4 years ago)
Author:
Henrik Bettermann
Message:

year (Year of Entrance) is no longer required when creating an applicants container.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
3 edited

Legend:

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

    r16129 r16190  
    230230    def addApplicantsContainer(self, **data):
    231231        year = data['year']
     232        if not data['container_number'] and not data['year']:
     233            self.flash(
     234              _('You must select either Year of Entrance or Container Number.'),
     235                type='warning')
     236            return
    232237        if not data['container_number']:
    233238            code = u'%s%s' % (data['prefix'], year)
     
    235240            code = u'%s%s' % (data['prefix'], data['container_number'])
    236241        apptypes_dict = getUtility(IApplicantsUtils).APP_TYPES_DICT
    237         title = apptypes_dict[data['prefix']][0]
    238         title = u'%s %s/%s' % (title, year, year + 1)
     242        title = u'%s' % apptypes_dict[data['prefix']][0]
     243        if year:
     244            title = u'%s %s/%s' % (title, year, year + 1)
    239245        if code in self.context.keys():
    240246            self.flash(
    241247              _('An applicants container for the same application '
    242                 'type and entrance year exists already in the database.'),
     248                'type and entrance year or container number '
     249                'already exists in the database.'),
    243250                type='warning')
    244251            return
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r16186 r16190  
    221221    year = schema.Choice(
    222222        title = _(u'Year of Entrance'),
    223         required = True,
     223        required = False,
    224224        values = year_range(),
    225         readonly = True,
     225        readonly = False,
    226226        )
    227227
     
    323323    year = schema.Choice(
    324324        title = _(u'Year of Entrance'),
    325         required = True,
     325        required = False,
    326326        values = year_range(),
    327327        readonly = False,
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r16120 r16190  
    364364            name="form.application_category").value = ['basic']
    365365        self.browser.getControl("Add applicants container").click()
    366         self.assertTrue('exists already in the database'
     366        self.assertTrue('already exists in the database'
    367367                        in self.browser.contents)
    368368        # Managers can add containers with prefix+number code instead of
Note: See TracChangeset for help on using the changeset viewer.