- Timestamp:
- 21 Nov 2019, 06:43:08 (5 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r15818 r15833 4 4 1.6.1.dev0 (unreleased) 5 5 ======================= 6 7 * Make max passport picture size customizable. 6 8 7 9 * Redirect to `ChangePasswordRequestPage` after successfully -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r15819 r15833 38 38 IApplicant, IApplicantEdit, IApplicantsRoot, 39 39 IApplicantsContainer, IApplicantsContainerAdd, 40 MAX_UPLOAD_SIZE,IApplicantOnlinePayment, IApplicantsUtils,40 IApplicantOnlinePayment, IApplicantsUtils, 41 41 IApplicantRegisterUpdate, ISpecialApplicant, 42 42 IApplicantRefereeReport … … 919 919 points to end of file when leaving this function. 920 920 """ 921 max_upload_size = getUtility(IKofaUtils).MAX_PASSPORT_SIZE 921 922 size = file_size(upload) 922 if size > MAX_UPLOAD_SIZE:923 if size > max_upload_size: 923 924 view.flash(_('Uploaded image is too big!'), type='danger') 924 925 return False … … 989 990 def update(self): 990 991 super(ApplicantManageFormPage, self).update() 992 max_upload_size = getUtility(IKofaUtils).MAX_PASSPORT_SIZE 991 993 self.wf_info = IWorkflowInfo(self.context) 992 self.max_upload_size = string_from_bytes( MAX_UPLOAD_SIZE)994 self.max_upload_size = string_from_bytes(max_upload_size) 993 995 self.upload_success = None 994 996 upload = self.request.form.get('form.passport', None) -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
r15790 r15833 40 40 AppCatSource, CertificateSource, SpecialApplicationSource) 41 41 42 #: Maximum upload size for applicant passport photographs (in bytes)43 MAX_UPLOAD_SIZE = 1024 * 5044 45 42 _marker = object() # a marker different from None 46 43 -
main/waeup.kofa/trunk/src/waeup/kofa/students/fileviewlets.py
r15652 r15833 22 22 from waeup.kofa.interfaces import MessageFactory as _ 23 23 from waeup.kofa.interfaces import ( 24 IExtFileStore, IFileStoreNameChooser, IKofaObject )24 IExtFileStore, IFileStoreNameChooser, IKofaObject, IKofaUtils) 25 25 from waeup.kofa.utils.helpers import string_from_bytes, file_size 26 26 from waeup.kofa.browser import DEFAULT_IMAGE_PATH … … 107 107 grok.template('imageupload') 108 108 label = _(u'Passport Picture (jpg only)') 109 mus = 1024 * 50110 109 download_name = u'passport.jpg' 111 110 tab_redirect = '#tab2' 111 112 @property 113 def mus(self): 114 kofa_utils = getUtility(IKofaUtils) 115 return kofa_utils.MAX_PASSPORT_SIZE 112 116 113 117 -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r15685 r15833 239 239 MAX_FILES = 100 240 240 241 #: Maximum size in Bytes of passport images in the applicants and 242 #: students section 243 MAX_PASSPORT_SIZE = 50 * 1024 244 241 245 #: Temporary passwords and parents password validity period 242 246 TEMP_PASSWORD_MINUTES = 10
Note: See TracChangeset for help on using the changeset viewer.