Ignore:
Timestamp:
21 Nov 2019, 06:43:08 (5 years ago)
Author:
Henrik Bettermann
Message:

Make max passport picture size customizable.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
2 edited

Legend:

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

    r15819 r15833  
    3838    IApplicant, IApplicantEdit, IApplicantsRoot,
    3939    IApplicantsContainer, IApplicantsContainerAdd,
    40     MAX_UPLOAD_SIZE, IApplicantOnlinePayment, IApplicantsUtils,
     40    IApplicantOnlinePayment, IApplicantsUtils,
    4141    IApplicantRegisterUpdate, ISpecialApplicant,
    4242    IApplicantRefereeReport
     
    919919    points to end of file when leaving this function.
    920920    """
     921    max_upload_size = getUtility(IKofaUtils).MAX_PASSPORT_SIZE
    921922    size = file_size(upload)
    922     if size > MAX_UPLOAD_SIZE:
     923    if size > max_upload_size:
    923924        view.flash(_('Uploaded image is too big!'), type='danger')
    924925        return False
     
    989990    def update(self):
    990991        super(ApplicantManageFormPage, self).update()
     992        max_upload_size = getUtility(IKofaUtils).MAX_PASSPORT_SIZE
    991993        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)
    993995        self.upload_success = None
    994996        upload = self.request.form.get('form.passport', None)
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r15790 r15833  
    4040    AppCatSource, CertificateSource, SpecialApplicationSource)
    4141
    42 #: Maximum upload size for applicant passport photographs (in bytes)
    43 MAX_UPLOAD_SIZE = 1024 * 50
    44 
    4542_marker = object() # a marker different from None
    4643
Note: See TracChangeset for help on using the changeset viewer.