Changeset 16926 for main/waeup.fceokene


Ignore:
Timestamp:
19 Apr 2022, 15:33:02 (3 years ago)
Author:
Henrik Bettermann
Message:

Resolve conflict of interfaces.

Location:
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants
Files:
4 edited

Legend:

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

    r16925 r16926  
    216216        target = getattr(container, 'prefix', None)
    217217        if target == 'tpu':
     218            school = 'school_tpu'
    218219            max = 10
    219220        else:
    220221            max = 7
     222            school = 'school_utp'
    221223        for appl in container.values():
    222224            if appl != self.context \
    223225                and appl.state in (SUBMITTED, ADMITTED, NOT_ADMITTED, CREATED):
    224                 if appl.school == data.get('school'):
     226                if getattr(appl, school) == data.get(school):
    225227                    counter += 1
    226228                    if appl.subj_comb == data.get('subj_comb'):
  • main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/export.py

    r16918 r16926  
    4747        """
    4848        SCHOOLS.update(SCHOOLS_UTP)
    49         if name == 'school' and value is not None:
     49        if name.startswith('school') and value is not None:
    5050            try:
    5151                value = '%s - %s - %s' % (
  • main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/interfaces.py

    r16924 r16926  
    188188        )
    189189
    190     school = schema.Choice(
     190    school_tpu = schema.Choice(
    191191        title = _(u'1st Choice TPZ and School'),
    192192        source = TPUSchoolSource(),
  • main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/tests/test_browser.py

    r16925 r16926  
    210210        self.browser.open(self.tpuapplicant_path + '/edit')
    211211        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
    212         self.browser.getControl(name="form.school").value = ['tpu0010']
     212        self.browser.getControl(name="form.school_tpu").value = ['tpu0010']
    213213        self.browser.getControl(name="form.subj_comb").value = ['NCECERT1']
    214214        image = open(SAMPLE_IMAGE, 'rb')
     
    226226            dummy.firstname = u'John'
    227227            dummy.lastname = u'Doe %s' %i
    228             dummy.school = 'tpu0010'
     228            dummy.school_tpu = 'tpu0010'
    229229            self.app['applicants'][
    230230                self.tpucontainer.code].addApplicant(dummy)
     
    233233        self.tpuapplicant.locked = False
    234234        self.browser.open(self.tpuapplicant_path + '/edit')
    235         self.browser.getControl(name="form.school").value = ['tpu0010']
     235        self.browser.getControl(name="form.school_tpu").value = ['tpu0010']
    236236        self.browser.getControl("Finally Submit").click()
    237237        self.assertTrue("Maximum number of applications per school exceeded."
     
    252252        dummy.firstname = u'John'
    253253        dummy.lastname = u'Doe %s' %i
    254         dummy.school = 'tpu0012'
     254        dummy.school_tpu = 'tpu0012'
    255255        dummy.subj_comb = certificate1
    256256        self.app['applicants'][
     
    258258        IWorkflowState(dummy).setState('submitted')
    259259        self.browser.open(self.tpuapplicant_path + '/edit')
    260         self.browser.getControl(name="form.school").value = ['tpu0012']
     260        self.browser.getControl(name="form.school_tpu").value = ['tpu0012']
    261261        self.browser.getControl(name="form.subj_comb").value = ['NCECERT1']
    262262        self.browser.getControl("Finally Submit").click()
     
    266266        self.assertEqual(self.tpuapplicant.state, 'paid')
    267267        self.browser.open(self.tpuapplicant_path + '/edit')
    268         self.browser.getControl(name="form.school").value = ['tpu0012']
     268        self.browser.getControl(name="form.school_tpu").value = ['tpu0012']
    269269        self.browser.getControl(name="form.subj_comb").value = ['NCECERT2']
    270270        self.browser.getControl("Finally Submit").click()
Note: See TracChangeset for help on using the changeset viewer.