Ignore:
Timestamp:
22 Jun 2013, 21:39:00 (11 years ago)
Author:
Henrik Bettermann
Message:

Remove futminna customizations which are not applicable here.

File:
1 edited

Legend:

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

    r10340 r10350  
    2828    ICustomApplicant,
    2929    ICustomUGApplicant,
    30     ICustomPGApplicant,
    31     ICustomPGApplicantEdit,
    3230    ICustomUGApplicantEdit,
    33     UG_OMIT_DISPLAY_FIELDS,
    34     UG_OMIT_PDF_FIELDS,
    35     UG_OMIT_MANAGE_FIELDS,
    36     UG_OMIT_EDIT_FIELDS,
    37     PG_OMIT_DISPLAY_FIELDS,
    38     PG_OMIT_PDF_FIELDS,
    39     PG_OMIT_MANAGE_FIELDS,
    40     PG_OMIT_EDIT_FIELDS,
    41     PUTME_OMIT_EDIT_FIELDS,
    42     PUTME_OMIT_DISPLAY_FIELDS,
    43     PUTME_OMIT_PDF_FIELDS,
    44     PUTME_OMIT_MANAGE_FIELDS,
    45     PUTME_OMIT_EDIT_FIELDS,
    4631    )
    4732from waeup.imostate.interfaces import MessageFactory as _
     
    10287    @property
    10388    def form_fields(self):
    104         if self.target is not None and self.target.startswith('pg'):
    105             form_fields = grok.AutoFields(ICustomPGApplicant)
    106             for field in PG_OMIT_DISPLAY_FIELDS:
    107                 form_fields = form_fields.omit(field)
    108         else:
    109             form_fields = grok.AutoFields(ICustomUGApplicant)
    110             for field in UG_OMIT_DISPLAY_FIELDS:
    111                 form_fields = form_fields.omit(field)
     89        form_fields = grok.AutoFields(ICustomUGApplicant)
    11290        if form_fields.get('perm_address', None):
    11391            form_fields['perm_address'].custom_widget = BytesDisplayWidget
     
    12199        if not getattr(self.context, 'screening_date'):
    122100            form_fields = form_fields.omit('screening_date')
    123         if not self.context.low_jamb_score:
    124             form_fields = form_fields.omit('course2')
    125101        return form_fields
    126102
     
    136112    @property
    137113    def form_fields(self):
    138         if self.target is not None and self.target.startswith('pg'):
    139             form_fields = grok.AutoFields(ICustomPGApplicant)
    140             for field in PG_OMIT_PDF_FIELDS:
    141                 form_fields = form_fields.omit(field)
    142         elif self.target is not None and self.target.startswith('putme'):
    143             form_fields = grok.AutoFields(ICustomUGApplicant)
    144             if self._reduced_slip():
    145                 for field in PUTME_OMIT_RESULT_SLIP_FIELDS:
    146                     form_fields = form_fields.omit(field)
    147         else:
    148             form_fields = grok.AutoFields(ICustomUGApplicant)
    149             for field in UG_OMIT_PDF_FIELDS:
    150                 form_fields = form_fields.omit(field)
     114        form_fields = grok.AutoFields(ICustomUGApplicant)
    151115        if not getattr(self.context, 'student_id'):
    152116            form_fields = form_fields.omit('student_id')
     
    157121        if not getattr(self.context, 'screening_date'):
    158122            form_fields = form_fields.omit('screening_date')
    159         if not self.context.low_jamb_score:
    160             form_fields = form_fields.omit('course2')
    161123        return form_fields
    162124
     
    168130    @property
    169131    def form_fields(self):
    170         if self.target is not None and self.target.startswith('pg'):
    171             form_fields = grok.AutoFields(ICustomPGApplicant)
    172             for field in PG_OMIT_MANAGE_FIELDS:
    173                 form_fields = form_fields.omit(field)
    174         elif self.target is not None and self.target.startswith('putme'):
    175             form_fields = grok.AutoFields(ICustomUGApplicant)
    176             for field in PUTME_OMIT_MANAGE_FIELDS:
    177                 form_fields = form_fields.omit(field)
    178         else:
    179             form_fields = grok.AutoFields(ICustomUGApplicant)
    180             for field in UG_OMIT_MANAGE_FIELDS:
    181                 form_fields = form_fields.omit(field)
     132        form_fields = grok.AutoFields(ICustomUGApplicant)
    182133        form_fields['student_id'].for_display = True
    183134        form_fields['applicant_id'].for_display = True
     
    223174    @property
    224175    def form_fields(self):
    225         if self.target is not None and self.target.startswith('pg'):
    226             form_fields = grok.AutoFields(ICustomPGApplicantEdit)
    227             for field in PG_OMIT_EDIT_FIELDS:
    228                 form_fields = form_fields.omit(field)
    229         elif self.target is not None and self.target.startswith('putme'):
    230             form_fields = grok.AutoFields(ICustomUGApplicantEdit)
    231             for field in PUTME_OMIT_EDIT_FIELDS:
    232                 form_fields = form_fields.omit(field)
    233         else:
    234             form_fields = grok.AutoFields(ICustomUGApplicantEdit)
    235             for field in UG_OMIT_EDIT_FIELDS:
    236                 form_fields = form_fields.omit(field)
     176        form_fields = grok.AutoFields(ICustomUGApplicantEdit)
    237177        form_fields['applicant_id'].for_display = True
    238178        form_fields['reg_number'].for_display = True
    239         if not self.context.low_jamb_score:
    240             form_fields = form_fields.omit('course2')
    241179        return form_fields
    242180
Note: See TracChangeset for help on using the changeset viewer.