Changeset 7084


Ignore:
Timestamp:
11 Nov 2011, 14:44:23 (13 years ago)
Author:
uli
Message:
  • Skip applicant data processing when image upload failed, avoiding double error messages.
  • Add hint about changed images in logs.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r7081 r7084  
    732732        self.wf_info = IWorkflowInfo(self.context)
    733733        self.max_upload_size = string_from_bytes(MAX_UPLOAD_SIZE)
     734        self.passport_changed = None
    734735        upload = self.request.form.get('form.passport', None)
    735736        if upload:
    736737            # We got a fresh upload
    737             passport_changed = handle_img_upload(upload, self.context, self)
     738            self.passport_changed = handle_img_upload(
     739                upload, self.context, self)
    738740        return
    739741
     
    760762    @grok.action('Save')
    761763    def save(self, **data):
     764        if self.passport_changed is False:  # False is not None!
     765            return # error during image upload. Ignore other values
    762766        changed_fields = self.applyData(self.context, **data)
    763767        changed_fields = changed_fields.values()
    764768        fields_string = '+'.join(
    765769            ' + '.join(str(i) for i in b) for b in changed_fields)
     770        if self.passport_changed:
     771            fields_string += ' + passport'
    766772        self.context._p_changed = True
    767773        form = self.request.form
     
    810816    @grok.action('Save')
    811817    def save(self, **data):
     818        if self.passport_changed is False:  # False is not None!
     819            return # error during image upload. Ignore other values
    812820        self.applyData(self.context, **data)
    813821        self.context._p_changed = True
     
    817825    @grok.action('Final Submit')
    818826    def finalsubmit(self, **data):
     827        if self.passport_changed is False:  # False is not None!
     828            return # error during image upload. Ignore other values
    819829        self.applyData(self.context, **data)
    820830        self.context._p_changed = True
Note: See TracChangeset for help on using the changeset viewer.