- Timestamp:
- 13 Apr 2022, 08:36:53 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/browser.py
r16874 r16918 49 49 BEC_OMIT_MANAGE_FIELDS, 50 50 BEC_OMIT_EDIT_FIELDS, 51 ITPURegistration 51 ITPURegistration, 52 IUTPRegistration 52 53 ) 53 54 … … 66 67 form_fields = grok.AutoFields(ITPURegistration).omit( 67 68 'locked', 'suspended') 69 return form_fields 70 if target == 'utp': 71 form_fields = grok.AutoFields(IUTPRegistration).omit( 72 'locked', 'suspended',) 68 73 return form_fields 69 74 form_fields = grok.AutoFields(ICustomUGApplicant) … … 118 123 'locked', 'suspended') 119 124 return form_fields 125 if target == 'utp': 126 form_fields = grok.AutoFields(IUTPRegistration).omit( 127 'locked', 'suspended') 128 return form_fields 120 129 form_fields = grok.AutoFields(ICustomUGApplicant) 121 130 if target is not None and target.startswith('bec'): … … 147 156 form_fields['applicant_id'].for_display = True 148 157 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 149 162 form_fields = grok.AutoFields(ICustomUGApplicant) 150 163 if target is not None and target.startswith('bec'): … … 176 189 form_fields['matric_number'].for_display = True 177 190 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 178 202 form_fields = grok.AutoFields(ICustomUGApplicantEdit) 179 203 if target is not None and target.startswith('bec'): … … 187 211 return form_fields 188 212 189 def _student _per_school_exceeded(self, data):213 def _students_per_school_exceeded(self, data): 190 214 container = self.context.__parent__ 191 215 counter = 0 … … 193 217 if appl != self.context \ 194 218 and appl.state in (SUBMITTED, ADMITTED, NOT_ADMITTED, CREATED): 195 if appl.school 1 == data.get('school1'):219 if appl.school == data.get('school'): 196 220 counter += 1 197 221 if appl.subj_comb == data.get('subj_comb'): … … 203 227 def dataNotComplete(self, data): 204 228 target = getattr(self.context.__parent__, 'prefix', None) 205 if target == 'tpu':206 if self._student _per_school_exceeded(data):207 return ("1st Choice TPZ andSchool: "229 if target in ('tpu', 'utp'): 230 if self._students_per_school_exceeded(data): 231 return ("1st Choice School: " 208 232 "Maximum number of applications per school exceeded. " 209 233 "Please select another first choice school.")
Note: See TracChangeset for help on using the changeset viewer.