- Timestamp:
- 20 Jan 2020, 17:23:31 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/browser.py
r15884 r15942 126 126 html = '' 127 127 pdf = getUtility(IExtFileStore).getFileByContext( 128 self.context, attr=' stateresult.pdf')128 self.context, attr='res_stat.pdf') 129 129 if pdf: 130 130 html += '<a href="%s">Statement of Result</a>' % self.url( 131 self.context, ' stateresult.pdf')131 self.context, 'res_stat.pdf') 132 132 return html 133 133 … … 174 174 def update(self): 175 175 super(CustomApplicantManageFormPage, self).update() 176 upload_ stateresult = self.request.form.get('form.stateresult', None)177 if upload_ stateresult:178 # We got a fresh stateresult upload176 upload_res_stat = self.request.form.get('form.res_stat', None) 177 if upload_res_stat: 178 # We got a fresh res_stat upload 179 179 success = handle_file_upload( 180 upload_ stateresult, self.context, self, attr='stateresult.pdf')180 upload_res_stat, self.context, self, attr='res_stat.pdf') 181 181 if success: 182 self.context.writeLogMessage(self, 'saved: stateresult')182 self.context.writeLogMessage(self, 'saved: res_stat') 183 183 else: 184 184 self.upload_success = False … … 199 199 return _('Passport picture confirmation box not ticked.') 200 200 if self.context.subtype == 'transfer' and \ 201 not store.getFileByContext(self.context, attr=u' stateresult.pdf'):201 not store.getFileByContext(self.context, attr=u'res_stat.pdf'): 202 202 return _('No statement of result pdf file uploaded.') 203 203 return False … … 224 224 return 225 225 super(CustomApplicantEditFormPage, self).update() 226 upload_ stateresult = self.request.form.get('form.stateresult', None)227 if upload_ stateresult:228 # We got a fresh stateresult upload226 upload_res_stat = self.request.form.get('form.res_stat', None) 227 if upload_res_stat: 228 # We got a fresh res_stat upload 229 229 success = handle_file_upload( 230 upload_ stateresult, self.context, self, attr='stateresult.pdf')230 upload_res_stat, self.context, self, attr='res_stat.pdf') 231 231 if not success: 232 232 self.upload_success = False … … 256 256 return form_fields 257 257 258 class StateResult(grok.View):258 class ResultStatement(grok.View): 259 259 """Renders the pdf form extension for applicants. 260 260 """ 261 grok.name(' stateresult.pdf')261 grok.name('res_stat.pdf') 262 262 grok.context(ICustomApplicant) 263 263 grok.require('waeup.viewApplication') … … 265 265 def render(self): 266 266 pdf = getUtility(IExtFileStore).getFileByContext( 267 self.context, attr=' stateresult.pdf')267 self.context, attr='res_stat.pdf') 268 268 self.response.setHeader('Content-Type', 'application/pdf') 269 269 return pdf
Note: See TracChangeset for help on using the changeset viewer.