Ignore:
Timestamp:
13 Apr 2022, 08:36:53 (2 years ago)
Author:
Henrik Bettermann
Message:

Implement UTP application.

File:
1 edited

Legend:

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

    r16874 r16918  
    4949    BEC_OMIT_MANAGE_FIELDS,
    5050    BEC_OMIT_EDIT_FIELDS,
    51     ITPURegistration
     51    ITPURegistration,
     52    IUTPRegistration
    5253    )
    5354
     
    6667            form_fields = grok.AutoFields(ITPURegistration).omit(
    6768                'locked', 'suspended')
     69            return form_fields
     70        if target == 'utp':
     71            form_fields = grok.AutoFields(IUTPRegistration).omit(
     72                'locked', 'suspended',)
    6873            return form_fields
    6974        form_fields = grok.AutoFields(ICustomUGApplicant)
     
    118123                'locked', 'suspended')
    119124            return form_fields
     125        if target == 'utp':
     126            form_fields = grok.AutoFields(IUTPRegistration).omit(
     127                'locked', 'suspended')
     128            return form_fields
    120129        form_fields = grok.AutoFields(ICustomUGApplicant)
    121130        if target is not None and target.startswith('bec'):
     
    147156            form_fields['applicant_id'].for_display = True
    148157            return form_fields
     158        if target == 'utp':
     159            form_fields = grok.AutoFields(IUTPRegistration)
     160            form_fields['applicant_id'].for_display = True
     161            return form_fields
    149162        form_fields = grok.AutoFields(ICustomUGApplicant)
    150163        if target is not None and target.startswith('bec'):
     
    176189            form_fields['matric_number'].for_display = True
    177190            return form_fields
     191        if target == 'utp':
     192            form_fields = grok.AutoFields(IUTPRegistration).omit(
     193                'locked', 'suspended')
     194            form_fields['applicant_id'].for_display = True
     195            form_fields['reg_number'].for_display = True
     196            form_fields['firstname'].for_display = True
     197            form_fields['middlename'].for_display = True
     198            form_fields['lastname'].for_display = True
     199            form_fields['lga'].for_display = True
     200            form_fields['matric_number'].for_display = True
     201            return form_fields
    178202        form_fields = grok.AutoFields(ICustomUGApplicantEdit)
    179203        if target is not None and target.startswith('bec'):
     
    187211        return form_fields
    188212
    189     def _student_per_school_exceeded(self, data):
     213    def _students_per_school_exceeded(self, data):
    190214        container = self.context.__parent__
    191215        counter = 0
     
    193217            if appl != self.context \
    194218                and appl.state in (SUBMITTED, ADMITTED, NOT_ADMITTED, CREATED):
    195                 if appl.school1 == data.get('school1'):
     219                if appl.school == data.get('school'):
    196220                    counter += 1
    197221                    if appl.subj_comb == data.get('subj_comb'):
     
    203227    def dataNotComplete(self, data):
    204228        target = getattr(self.context.__parent__, 'prefix', None)
    205         if target == 'tpu':
    206             if self._student_per_school_exceeded(data):
    207                 return ("1st Choice TPZ and School: "
     229        if target in ('tpu', 'utp'):
     230            if self._students_per_school_exceeded(data):
     231                return ("1st Choice School: "
    208232                        "Maximum number of applications per school exceeded. "
    209233                        "Please select another first choice school.")
Note: See TracChangeset for help on using the changeset viewer.