- Timestamp:
- 4 Jan 2015, 17:19:06 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py
r12394 r12395 144 144 except: 145 145 return False, 'Unknown Error' 146 # Finally prove if the certificate still exists146 # Prove if the certificate still exists 147 147 try: 148 148 StudentStudyCourse().certificate = self.course_admitted 149 149 except ConstraintNotSatisfied, err: 150 150 return False, 'ConstraintNotSatisfied: %s' % self.course_admitted.code 151 # Finally prove if an application slip can be created 152 try: 153 applicant_slip = getAdapter(self, IPDF, name='application_slip')( 154 view=view) 155 except IOError: 156 return False, _('IOError: Application Slip could not be created.') 151 157 # Add student 152 158 site = grok.getSite() … … 165 171 notify(grok.ObjectModifiedEvent(student)) 166 172 # Save application slip 167 try: 168 self._createApplicationPDF(student, view=view) 169 return True, _('Student ${a} created', mapping = {'a':student.student_id}) 170 except IOError: 171 return False, _('IOError: Application Slip could not be created.') 172 173 def _createApplicationPDF(self, student, view=None): 173 self._saveApplicationPDF(student, applicant_slip, view=view) 174 return True, _('Student ${a} created', mapping = {'a':student.student_id}) 175 176 def _saveApplicationPDF(self, student, applicant_slip, view=None): 174 177 """Create an application slip as PDF and store it in student folder. 175 178 """ 176 179 file_store = getUtility(IExtFileStore) 177 applicant_slip = getAdapter(self, IPDF, name='application_slip')(178 view=view)179 180 file_id = IFileStoreNameChooser(student).chooseName( 180 181 attr="application_slip.pdf")
Note: See TracChangeset for help on using the changeset viewer.