Ignore:
Timestamp:
11 Jul 2012, 07:55:14 (12 years ago)
Author:
Henrik Bettermann
Message:

Do not show current and previous verdict if postgrad student.

Fix is_postgrad property method.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r8921 r8972  
    599599    grok.name('index')
    600600    grok.require('waeup.viewStudent')
    601     form_fields = grok.AutoFields(IStudentStudyCourse)
    602601    grok.template('studycoursepage')
    603602    pnav = 4
     603
     604    @property
     605    def form_fields(self):
     606        if self.context.is_postgrad:
     607            form_fields = grok.AutoFields(IStudentStudyCourse).omit(
     608                'current_verdict', 'previous_verdict')
     609        else:
     610            form_fields = grok.AutoFields(IStudentStudyCourse)
     611        return form_fields
    604612
    605613    @property
     
    634642    grok.require('waeup.manageStudent')
    635643    grok.template('studycoursemanagepage')
    636     form_fields = grok.AutoFields(IStudentStudyCourse)
    637644    label = _('Manage study course')
    638645    pnav = 4
     
    640647    tabtwoactions = [_('Remove selected levels'),_('Cancel')]
    641648    tabthreeactions = [_('Add study level')]
     649
     650    @property
     651    def form_fields(self):
     652        if self.context.is_postgrad:
     653            form_fields = grok.AutoFields(IStudentStudyCourse).omit(
     654                'current_verdict', 'previous_verdict')
     655        else:
     656            form_fields = grok.AutoFields(IStudentStudyCourse)
     657        return form_fields
    642658
    643659    def update(self):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/studycourse.py

    r8736 r8972  
    6161    @property
    6262    def is_postgrad(self):
     63        if self.certificate is None:
     64            return False
    6365        return self.certificate.study_mode.startswith('pg')
    64         #return cert.start_level == 999 or cert.end_level == 999
    6566
    6667    def addStudentStudyLevel(self, cert, studylevel):
Note: See TracChangeset for help on using the changeset viewer.