Changeset 15548


Ignore:
Timestamp:
19 Aug 2019, 10:27:05 (5 years ago)
Author:
Henrik Bettermann
Message:

Allow to add applicants containers with a number instead of entrance year
in container code.

Location:
main/waeup.kofa/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r15546 r15548  
    441.6.1.dev0 (unreleased)
    55=======================
     6
     7* Allow to add applicants containers with a number instead of entrance year
     8  in container code.
    69
    710* Add semester filter to Fix `CourseTicketExporter`.
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r15502 r15548  
    225225    def addApplicantsContainer(self, **data):
    226226        year = data['year']
    227         code = u'%s%s' % (data['prefix'], year)
     227        if not data['container_number']:
     228            code = u'%s%s' % (data['prefix'], year)
     229        else:
     230            code = u'%s%s' % (data['prefix'], data['container_number'])
    228231        apptypes_dict = getUtility(IApplicantsUtils).APP_TYPES_DICT
    229232        title = apptypes_dict[data['prefix']][0]
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r15502 r15548  
    325325        )
    326326
     327    container_number = schema.Choice(
     328        title = _(u'Container Number'),
     329        values = (1,2,3,4,5,6,7,8,9),
     330        description = _(u'If set, this number will be added to the container '
     331                         'prefix (e.g. app3). If not set, the year of entrance will be '
     332                         'used (e.g. app2019).'),
     333        required = False,
     334        readonly = False,
     335        )
     336
    327337IApplicantsContainerAdd[
    328338    'prefix'].order =  IApplicantsContainer['prefix'].order
    329339IApplicantsContainerAdd[
    330340    'year'].order =  IApplicantsContainer['year'].order
     341IApplicantsContainerAdd[
     342    'container_number'].order =  IApplicantsContainer['year'].order
    331343
    332344class IApplicantBaseData(IKofaObject):
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r15287 r15548  
    365365        self.assertTrue('exists already in the database'
    366366                        in self.browser.contents)
     367        # Managers can add containers with prefix+number code instead of
     368        # prefix+year code.
     369        self.browser.open(self.add_container_path)
     370        self.browser.getControl(name="form.prefix").value = ['app']
     371        self.browser.getControl(name="form.year").value = [str(session_2)]
     372        self.browser.getControl(name="form.container_number").value = ['8']
     373        self.browser.getControl(name="form.mode").value = ['create']
     374        self.browser.getControl(
     375            name="form.application_category").value = ['basic']
     376        self.browser.getControl("Add applicants container").click()
     377        self.assertTrue('Added: "app8"' in self.browser.contents)
     378        self.browser.getLink(container_name_1).click()
     379        self.assertTrue('Manage applicants container'
     380            in self.browser.contents)
    367381        self.browser.open(self.manage_root_path)
    368382        ctrl = self.browser.getControl(name='val_id')
Note: See TracChangeset for help on using the changeset viewer.