- Timestamp:
- 16 Jan 2020, 11:04:43 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py
r15930 r15932 156 156 and copy applicant data. 157 157 """ 158 site = grok.getSite() 158 159 # Is applicant in the correct state? 159 160 if self.state != 'admitted': … … 164 165 student.reg_number = self.reg_number 165 166 except RegNumNotInSource: 167 # Reset _curr_stud_id 168 site['students']._curr_stud_id -= 1 166 169 return False, _('Registration Number exists.') 167 170 # Has the course_admitted field been properly filled? 168 171 if self.course_admitted is None: 172 # Reset _curr_stud_id 173 site['students']._curr_stud_id -= 1 169 174 return False, _('No course admitted provided.') 170 175 # Set student attributes … … 173 178 setattr(student, item[1], getattr(self, item[0], None)) 174 179 except RequiredMissing, err: 180 site['students']._curr_stud_id -= 1 175 181 return False, 'RequiredMissing: %s' % err 176 182 except: 183 site['students']._curr_stud_id -= 1 177 184 return False, 'Unknown Error' 178 185 # Prove if the certificate still exists … … 180 187 StudentStudyCourse().certificate = self.course_admitted 181 188 except ConstraintNotSatisfied, err: 189 # Reset _curr_stud_id 190 site['students']._curr_stud_id -= 1 182 191 return False, 'ConstraintNotSatisfied: %s' % self.course_admitted.code 183 192 # Finally prove if an application slip can be created … … 186 195 view=view) 187 196 except IOError: 197 site['students']._curr_stud_id -= 1 188 198 return False, _('IOError: Application Slip could not be created.') 189 199 except LayoutError, err: 200 site['students']._curr_stud_id -= 1 190 201 return False, _('Reportlab LayoutError: %s' % err) 191 202 except AttributeError, err: 203 site['students']._curr_stud_id -= 1 192 204 return False, _('Reportlab AttributeError: ${a}', mapping = {'a':err}) 193 205 except: 206 site['students']._curr_stud_id -= 1 194 207 return False, _('Unknown Reportlab error') 195 208 # Add student 196 site = grok.getSite()197 209 site['students'].addStudent(student) 198 210 # Save student_id
Note: See TracChangeset for help on using the changeset viewer.