- Timestamp:
- 21 Sep 2012, 08:19:35 (12 years ago)
- Location:
- main/waeup.kofa/branches/uli-zc-async
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/uli-zc-async
- Property svn:mergeinfo changed
/main/waeup.kofa/branches/uli-async-update removed /main/waeup.kofa/branches/uli-autoinclude-less removed /main/waeup.kofa/trunk removed
- Property svn:mergeinfo changed
-
main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/applicant.py
r9209 r9211 27 27 from zope.securitypolicy.interfaces import IPrincipalRoleManager 28 28 from zope.interface import implementedBy 29 from zope.schema.interfaces import RequiredMissing , ConstraintNotSatisfied29 from zope.schema.interfaces import RequiredMissing 30 30 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 31 31 from waeup.kofa.image import KofaImageFile … … 36 36 from waeup.kofa.interfaces import MessageFactory as _ 37 37 from waeup.kofa.students.vocabularies import RegNumNotInSource 38 from waeup.kofa.students.studycourse import StudentStudyCourse39 38 from waeup.kofa.utils.helpers import attrs_to_fields 40 39 from waeup.kofa.applicants.interfaces import IApplicant, IApplicantEdit … … 119 118 if self.course_admitted is None: 120 119 return False, _('No course admitted provided.') 121 # Set student attributes120 # Add student object 122 121 try: 123 122 for name in self.create_names: 124 123 setattr(student, name, getattr(self, name, None)) 125 124 except RequiredMissing, err: 126 return False, 'RequiredMissing: %s' % err 127 except: 128 return False, 'Error: %s' % err 129 # Finally prove if the certificate still exists 130 try: 131 StudentStudyCourse().certificate = self.course_admitted 132 except ConstraintNotSatisfied, err: 133 return False, 'ConstraintNotSatisfied: %s' % self.course_admitted.code 134 # Add student 125 return False, _('RequiredMissing: %s' % err) 135 126 site = grok.getSite() 136 127 site['students'].addStudent(student) 137 # Save student_id138 128 self.student_id = student.student_id 139 # Fire transitions140 129 IWorkflowInfo(self).fireTransition('create') 141 130 IWorkflowInfo(student).fireTransition('admit') 131 142 132 # Set password 143 133 IUserAccount(student).setPassword(self.application_number) 134 144 135 # Save the certificate and set session attributes 145 136 student['studycourse'].certificate = self.course_admitted … … 151 142 # Update the catalog 152 143 notify(grok.ObjectModifiedEvent(student)) 144 153 145 # Save application slip 154 146 self._createApplicationPDF(student, view=view)
Note: See TracChangeset for help on using the changeset viewer.