Changeset 15576 for main


Ignore:
Timestamp:
3 Sep 2019, 08:08:55 (5 years ago)
Author:
Henrik Bettermann
Message:

Add convocation pack payment application type. This is not a special payment but the forms are special.

Location:
main/kofacustom.dspg/trunk/src/kofacustom/dspg/applicants
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/applicants/browser.py

    r15536 r15576  
    164164        if self.context.special:
    165165            return grok.AutoFields(ICustomSpecialApplicant)
     166        if self.target == 'conv':
     167            form_fields = grok.AutoFields(ICustomSpecialApplicant)
     168            form_fields = form_fields.omit(
     169                'special_application', 'carryover_courses',
     170                'locked', 'suspended')
     171            return form_fields
    166172        form_fields = grok.AutoFields(ICustomUGApplicant)
    167173        if self.context.is_nd:
     
    220226    @property
    221227    def form_fields(self):
     228        if self.target == 'conv':
     229            form_fields = grok.AutoFields(ICustomSpecialApplicant)
     230            form_fields = form_fields.omit(
     231                'special_application', 'carryover_courses',
     232                'locked', 'suspended')
     233            return form_fields
    222234        form_fields = grok.AutoFields(ICustomUGApplicant)
    223235        if self.context.is_nd:
     
    248260            form_fields['applicant_id'].for_display = True
    249261            return form_fields
     262        if self.target == 'conv':
     263            form_fields = grok.AutoFields(ICustomSpecialApplicant)
     264            form_fields = form_fields.omit(
     265                'special_application', 'carryover_courses',
     266                'locked', 'suspended')
     267            return form_fields
    250268        form_fields = grok.AutoFields(ICustomUGApplicant)
    251269        if self.context.is_nd:
     
    278296                'locked', 'suspended')
    279297            form_fields['applicant_id'].for_display = True
     298            return form_fields
     299        if self.target == 'conv':
     300            form_fields = grok.AutoFields(ICustomSpecialApplicant)
     301            form_fields = form_fields.omit(
     302                'special_application', 'carryover_courses',
     303                'locked', 'suspended')
    280304            return form_fields
    281305        form_fields = grok.AutoFields(ICustomUGApplicantEdit)
     
    325349    def custom_requirements(self):
    326350        store = getUtility(IExtFileStore)
    327         if not store.getFileByContext(self.context, attr=u'passport.jpg'):
     351        if not store.getFileByContext(self.context, attr=u'passport.jpg') \
     352            and self.context.__parent__.with_picture:
    328353            return _('Upload your passport photo before making payment.')
    329354        return ''
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/applicants/interfaces.py

    r15189 r15576  
    1919"""
    2020
     21from datetime import datetime
    2122from zope import schema
    2223from waeup.kofa.applicants.interfaces import (
     
    282283    """
    283284
     285def grad_year_range():
     286    curr_year = datetime.now().year
     287    return range(curr_year - 10, curr_year + 0)
     288
    284289class ICustomSpecialApplicant(ISpecialApplicant):
    285290
     
    294299        title = _(u'Department'),
    295300        required = True,
     301        readonly = False,
     302        )
     303
     304    grad_year = schema.Choice(
     305        title = _(u'Year of Graduation'),
     306        required = True,
     307        values = grad_year_range(),
    296308        readonly = False,
    297309        )
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/applicants/utils.py

    r14721 r15576  
    5353        'prejambites': ['Pre-Admission Security Screening and Results Verification: JAMBITES', 'JMB'],
    5454        'special': ['Supplementary Payment', 'SP'],
     55        'conv': ['Convocation Pack Payment', 'CPP'],
    5556        }
    5657
Note: See TracChangeset for help on using the changeset viewer.