Changeset 16863


Ignore:
Timestamp:
8 Mar 2022, 08:23:06 (3 years ago)
Author:
Henrik Bettermann
Message:

Remove condition.

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

Legend:

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

    r16848 r16863  
    189189    def _student_per_school_exceeded(self, data):
    190190        container = self.context.__parent__
    191         counter = 0
     191        counter = 1
    192192        for appl in container.values():
    193             if appl.state in (SUBMITTED, ADMITTED, NOT_ADMITTED, CREATED):
    194                 if appl.school1 == self.context.school1 \
    195                     or appl.school1 == data.get('school1'):
     193            if appl != self.context \
     194                and appl.state in (SUBMITTED, ADMITTED, NOT_ADMITTED, CREATED):
     195                if appl.school1 == data.get('school1'):
    196196                    counter += 1
    197                     if appl != self.context \
    198                         and (appl.subj_comb == self.context.subj_comb \
    199                             or appl.subj_comb == data.get('subj_comb')):
     197                    if appl.subj_comb == data.get('subj_comb'):
    200198                        return True
    201199                if counter == 10:
  • main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/tests/test_browser.py

    r16854 r16863  
    232232            in self.browser.contents)
    233233        self.assertEqual(self.tpuapplicant.state, 'paid')
     234        # Create second certificate
     235        certificate = createObject('waeup.Certificate')
     236        certificate.code = 'CERT2'
     237        certificate.title = 'NCECert2'
     238        certificate.application_category = 'tpu'
     239        certificate.start_level = 100
     240        certificate.end_level = 500
     241        certificate.study_mode = u'nce_ft'
     242        self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
     243            certificate)
    234244        # Create one applicant with same subject and same school
    235245        dummy = createObject(u'waeup.Applicant')
     
    247257        self.assertTrue("Maximum number of applications per school exceeded."
    248258            in self.browser.contents)
     259        # Same school with another subj_comb canbe submitted
    249260        self.assertEqual(self.tpuapplicant.state, 'paid')
    250261        self.browser.open(self.tpuapplicant_path + '/edit')
    251         self.browser.getControl(name="form.school1").value = ['s0013']
    252         self.browser.getControl(name="form.subj_comb").value = ['CERT1']
    253         self.browser.getControl("Finally Submit").click()
    254         self.assertTrue(
    255             'Application submitted' in self.browser.contents)
     262        self.browser.getControl(name="form.school1").value = ['s0012']
     263        self.browser.getControl(name="form.subj_comb").value = ['CERT2']
     264        self.browser.getControl("Finally Submit").click()
    256265        self.assertEqual(self.tpuapplicant.state, 'submitted')
    257266        return
Note: See TracChangeset for help on using the changeset viewer.