Ignore:
Timestamp:
28 Jul 2012, 11:01:38 (12 years ago)
Author:
Henrik Bettermann
Message:

Do not display screening score, venue and date if not set.

File:
1 edited

Legend:

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

    r9072 r9076  
    9999        #form_fields['perm_address'].custom_widget = BytesDisplayWidget
    100100        form_fields['notice'].custom_widget = BytesDisplayWidget
     101        if not getattr(self.context, 'student_id'):
     102            form_fields = form_fields.omit('student_id')
     103        if not getattr(self.context, 'screening_score'):
     104            form_fields = form_fields.omit('screening_score')
     105        if not getattr(self.context, 'screening_venue'):
     106            form_fields = form_fields.omit('screening_venue')
     107        if not getattr(self.context, 'screening_date'):
     108            form_fields = form_fields.omit('screening_date')
    101109        return form_fields
    102110
     
    106114        return getattr(self.context, 'result_uploaded', False)
    107115
    108     @property
    109     def note(self):
    110         target = getattr(self.context.__parent__, 'prefix', None)
    111         if target is not None and not target.startswith('pg') \
    112             and not self._reduced_slip():
    113             return _(u'<br /><br /><br />'
    114                       'Comfirm your exam venue 72 hours to the exam.')
    115         return
     116    #@property
     117    #def note(self):
     118    #    target = getattr(self.context.__parent__, 'prefix', None)
     119    #    if target is not None and not target.startswith('pg') \
     120    #        and not self._reduced_slip():
     121    #        return _(u'<br /><br /><br />'
     122    #                  'Comfirm your exam venue 72 hours to the exam.')
     123    #    return
    116124
    117125    @property
     
    144152        if not getattr(self.context, 'student_id'):
    145153            form_fields = form_fields.omit('student_id')
     154        if not getattr(self.context, 'screening_score'):
     155            form_fields = form_fields.omit('screening_score')
     156        if not getattr(self.context, 'screening_venue'):
     157            form_fields = form_fields.omit('screening_venue')
     158        if not getattr(self.context, 'screening_date'):
     159            form_fields = form_fields.omit('screening_date')
    146160        return form_fields
    147161
Note: See TracChangeset for help on using the changeset viewer.