Changeset 17054


Ignore:
Timestamp:
2 Aug 2022, 22:46:19 (2 years ago)
Author:
Henrik Bettermann
Message:

Catch error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py

    r16955 r17054  
    251251        # Save student_id
    252252        self.student_id = student.student_id
    253         if graduated:
    254             # Set state
    255             IWorkflowState(student).setState('graduated')
    256             # Save the certificate and set study course attributes
    257             self._setGraduatedStudyCourseAttributes(student['studycourse'])
    258         else:
    259             # Fire transitions
    260             IWorkflowInfo(self).fireTransition('create')
    261             IWorkflowInfo(student).fireTransition('admit')
    262             # Save the certificate and set study course attributes
    263             self._setStudyCourseAttributes(student['studycourse'])
     253        try:
     254            if graduated:
     255                # Set state
     256                IWorkflowState(student).setState('graduated')
     257                # Save the certificate and set study course attributes
     258                self._setGraduatedStudyCourseAttributes(student['studycourse'])
     259            else:
     260                # Fire transitions
     261                IWorkflowInfo(self).fireTransition('create')
     262                IWorkflowInfo(student).fireTransition('admit')
     263                # Save the certificate and set study course attributes
     264                self._setStudyCourseAttributes(student['studycourse'])
     265        except ConstraintNotSatisfied, err:
     266            return False, _('ConstraintNotSatisfied: ${a}', mapping = {'a':err})
    264267        # Set password
    265268        IUserAccount(student).setPassword(self.application_number)
Note: See TracChangeset for help on using the changeset viewer.