Ignore:
Timestamp:
11 Nov 2011, 16:37:03 (13 years ago)
Author:
Henrik Bettermann
Message:

Increase MAX_UPLOAD_SIZE, 20 kB is more realistic.

We can import DEFAULT_PASSPORT_IMAGE_MALE directly instead of IMAGE_PATH. That means configuration is solely done in interfaces.py not in browser.py.

DEFAULT_PASSPORT_IMAGE_FEMALE is no longer used.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
3 edited

Legend:

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

    r7085 r7086  
    6868    IApplicant, IApplicantPrincipal,IApplicantEdit, IApplicantsRoot,
    6969    IApplicantsContainer, IApplicantsContainerAdd, application_types_vocab,
    70     IMAGE_PATH, MAX_UPLOAD_SIZE,
     70     DEFAULT_PASSPORT_IMAGE_MALE, MAX_UPLOAD_SIZE,
    7171    )
    7272from waeup.sirp.applicants.workflow import INITIALIZED, STARTED
     
    655655        img = getUtility(IExtFileStore).getFileByContext(self.context)
    656656        if img is None:
    657             img = open(os.path.join(IMAGE_PATH, 'placeholder_m.jpg'), 'rb')
     657            img = DEFAULT_PASSPORT_IMAGE_MALE
    658658        doc_img = Image(img.name, width=4*cm, height=3*cm, kind='bound')
    659659        story.append(doc_img)
     
    868868        if image is None:
    869869            # show placeholder image
    870             return open(os.path.join(IMAGE_PATH, 'placeholder_m.jpg'), 'rb')
     870            return DEFAULT_PASSPORT_IMAGE_MALE
    871871        return image
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py

    r7075 r7086  
    4949    )
    5050DEFAULT_PASSPORT_IMAGE_MALE = open(
    51     os.path.join(IMAGE_PATH, 'placeholder_m.jpg')).read()
    52 DEFAULT_PASSPORT_IMAGE_FEMALE = open(
    53     os.path.join(IMAGE_PATH, 'placeholder_f.jpg')).read()
     51    os.path.join(IMAGE_PATH, 'placeholder_m.jpg'))
    5452
    5553#: Maximum upload size for applicant passport photographs (in bytes)
    56 MAX_UPLOAD_SIZE = 1024 * 10
     54MAX_UPLOAD_SIZE = 1024 * 20
    5755
    5856# Define a valiation method for email addresses
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py

    r7083 r7086  
    666666        self.login()
    667667        # Create a pseudo image file and select it to be uploaded in form
    668         photo_content = 'A' * 1024 * 11  # A string of 11 GB size
     668        photo_content = 'A' * 1024 * 21  # A string of 11 GB size
    669669        pseudo_image = StringIO(photo_content)
    670670        ctrl = self.browser.getControl(name='form.passport')
Note: See TracChangeset for help on using the changeset viewer.