Changeset 14883


Ignore:
Timestamp:
26 Oct 2017, 08:29:36 (7 years ago)
Author:
Henrik Bettermann
Message:

Catch error.

Location:
main/kofacustom.dspg/trunk/src/kofacustom/dspg/students
Files:
2 edited

Legend:

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

    r14882 r14883  
    5858        if not store.getFileByContext(self.context, attr=u'o_level_result.jpg'):
    5959            return _('No O Level result uploaded.')
    60         if self.context.current_mode.startswith('nd'):
     60        cm = getattr(self.context,'current_mode', None)
     61        if cm and cm.startswith('nd'):
    6162            if not store.getFileByContext(self.context, attr=u'jamb_result.jpg'):
    6263                return _('No JAMB result uploaded.')
    63         elif self.context.current_mode.startswith('hnd'):
     64        elif cm and cm.startswith('hnd'):
    6465            if not store.getFileByContext(self.context, attr=u'nd_result.jpg'):
    6566                return _('No ND result uploaded.')
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/students/viewlets.py

    r14882 r14883  
    5959        if self.__name__ in students_utils.SKIP_UPLOAD_VIEWLETS:
    6060            return False
    61         return self.context.current_mode.startswith('hnd')
     61        cm = getattr(self.context,'current_mode', None)
     62        return cm and cm.startswith('hnd')
    6263
    6364class NDResultImage(StudentImage):
     
    122123        if self.__name__ in students_utils.SKIP_UPLOAD_VIEWLETS:
    123124            return False
    124         return self.context.current_mode.startswith('hnd')
     125        cm = getattr(self.context,'current_mode', None)
     126        return cm and cm.startswith('hnd')
    125127
    126128class ITLetterImage(StudentImage):
     
    153155    @property
    154156    def label(self):
    155         if self.context.current_mode.startswith('hnd'):
     157        cm = getattr(self.context,'current_mode', None)
     158        if cm and cm.startswith('hnd'):
    156159            return u'JAMB Result / ND Admission Letter (optional)'
    157160        else:
Note: See TracChangeset for help on using the changeset viewer.