Changeset 10090 for main/waeup.kofa/trunk
- Timestamp:
- 22 Apr 2013, 10:36:25 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r9984 r10090 796 796 self.wf_info = IWorkflowInfo(self.context) 797 797 self.max_upload_size = string_from_bytes(MAX_UPLOAD_SIZE) 798 self.passport_changed = None 798 self.files_uploaded = [] 799 self.upload_success = None 799 800 upload = self.request.form.get('form.passport', None) 800 801 if upload: 801 # We got a fresh upload 802 self.passport_changed = handle_img_upload( 802 # We got a fresh upload, upload_success is 803 # either True or False 804 self.upload_success = handle_img_upload( 803 805 upload, self.context, self) 806 if self.upload_success: 807 self.files_uploaded.append('passport') 804 808 return 805 809 … … 833 837 self.flash( ' '.join(errors)) 834 838 return 835 if self.passport_changed is False: # False is not None! 836 return # error during image upload. Ignore other values 839 if self.upload_success is False: # False is not None! 840 # Error during image upload. Ignore other values. 841 # In custom packages other file uploads might have been 842 # successful. 843 changed_fields = self.files_uploaded 844 fields_string = ' + '.join(changed_fields) 845 if fields_string: 846 self.context.writeLogMessage(self, 'saved: % s' % fields_string) 847 return 837 848 changed_fields = self.applyData(self.context, **data) 838 849 # Turn list of lists into single list … … 841 852 else: 842 853 changed_fields = [] 843 if self. passport_changed:844 changed_fields .append('passport')854 if self.upload_success: 855 changed_fields += self.files_uploaded 845 856 if password: 846 857 # Now we know that the form has no errors and can set password ... … … 973 984 @action(_('Save'), style='primary') 974 985 def save(self, **data): 975 if self.passport_changed is False: # False is not None! 976 return # error during image upload. Ignore other values 986 if self.upload_success is False: # False is not None! 987 # Error during image upload. Ignore other values. 988 # In custom packages other file uploads might have been 989 # successful. 990 changed_fields = self.files_uploaded 991 fields_string = ' + '.join(changed_fields) 992 if fields_string: 993 self.context.writeLogMessage(self, 'saved: % s' % fields_string) 994 return 977 995 self.applyData(self.context, **data) 978 996 self.flash('Form has been saved.') … … 981 999 @submitaction(_('Final Submit')) 982 1000 def finalsubmit(self, **data): 983 if self. passport_changedis False: # False is not None!1001 if self.upload_success is False: # False is not None! 984 1002 return # error during image upload. Ignore other values 985 1003 if self.dataNotComplete():
Note: See TracChangeset for help on using the changeset viewer.