Ignore:
Timestamp:
20 Jan 2020, 17:23:31 (5 years ago)
Author:
Henrik Bettermann
Message:

Rename stateresult file and adjust to base package.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/browser.py

    r15884 r15942  
    126126        html = ''
    127127        pdf = getUtility(IExtFileStore).getFileByContext(
    128             self.context, attr='stateresult.pdf')
     128            self.context, attr='res_stat.pdf')
    129129        if pdf:
    130130            html += '<a href="%s">Statement of Result</a>' % self.url(
    131                 self.context, 'stateresult.pdf')
     131                self.context, 'res_stat.pdf')
    132132        return html
    133133
     
    174174    def update(self):
    175175        super(CustomApplicantManageFormPage, self).update()
    176         upload_stateresult = self.request.form.get('form.stateresult', None)
    177         if upload_stateresult:
    178             # We got a fresh stateresult upload
     176        upload_res_stat = self.request.form.get('form.res_stat', None)
     177        if upload_res_stat:
     178            # We got a fresh res_stat upload
    179179            success = handle_file_upload(
    180                 upload_stateresult, self.context, self, attr='stateresult.pdf')
     180                upload_res_stat, self.context, self, attr='res_stat.pdf')
    181181            if success:
    182                 self.context.writeLogMessage(self, 'saved: stateresult')
     182                self.context.writeLogMessage(self, 'saved: res_stat')
    183183            else:
    184184                self.upload_success = False
     
    199199                return _('Passport picture confirmation box not ticked.')
    200200        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'):
    202202            return _('No statement of result pdf file uploaded.')
    203203        return False
     
    224224            return
    225225        super(CustomApplicantEditFormPage, self).update()
    226         upload_stateresult = self.request.form.get('form.stateresult', None)
    227         if upload_stateresult:
    228             # We got a fresh stateresult upload
     226        upload_res_stat = self.request.form.get('form.res_stat', None)
     227        if upload_res_stat:
     228            # We got a fresh res_stat upload
    229229            success = handle_file_upload(
    230                 upload_stateresult, self.context, self, attr='stateresult.pdf')
     230                upload_res_stat, self.context, self, attr='res_stat.pdf')
    231231            if not success:
    232232                self.upload_success = False
     
    256256        return form_fields
    257257
    258 class StateResult(grok.View):
     258class ResultStatement(grok.View):
    259259    """Renders the pdf form extension for applicants.
    260260    """
    261     grok.name('stateresult.pdf')
     261    grok.name('res_stat.pdf')
    262262    grok.context(ICustomApplicant)
    263263    grok.require('waeup.viewApplication')
     
    265265    def render(self):
    266266        pdf = getUtility(IExtFileStore).getFileByContext(
    267             self.context, attr='stateresult.pdf')
     267            self.context, attr='res_stat.pdf')
    268268        self.response.setHeader('Content-Type', 'application/pdf')
    269269        return pdf
Note: See TracChangeset for help on using the changeset viewer.