Ignore:
Timestamp:
17 Nov 2017, 16:12:06 (7 years ago)
Author:
Henrik Bettermann
Message:

Add ´is_student´ property attribute to student objects.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/students
Files:
5 edited

Legend:

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

    r14835 r14902  
    135135                       'phone', 'adm_code', 'email', 'date_of_birth',
    136136                       'flash_notice')
    137         if self.context.faccode == 'JUPEB':
     137        if self.context.is_jupeb:
    138138            omit_fields += ('faculty', 'department')
    139139        return omit_fields
     
    143143        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    144144        line0 = ''
    145         if self.context.faccode == 'JUPEB':
     145        if self.context.is_jupeb:
    146146            line0 = 'Joint Universities Preliminary Examinations Board (JUPEB)\n'
    147147        line1 = translate(_('Clearance Slip of'),
     
    307307
    308308    def update(self):
    309         if not self.context.flash_notice or self.context.faccode != 'JUPEB' \
     309        if not self.context.flash_notice or not self.context.is_jupeb \
    310310            or not 'results' in self.context.flash_notice.lower():
    311311            self.flash(_('Forbidden'), type="warning")
  • main/waeup.uniben/trunk/src/waeup/uniben/students/student.py

    r13085 r14902  
    4141    def transcript_enabled(self):
    4242        user = get_current_principal()
    43         if user.id in ('admin', 'isouaba', 'med', 'delejason', 'zope.mgr'):
     43        if user.id in ('admin', 'isouaba', 'med', 'zope.mgr'):
     44            return True
     45        return False
     46
     47    @property
     48    def is_jupeb(self):
     49        if self.faccode.startswith('JUPEB'):
    4450            return True
    4551        return False
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r14898 r14902  
    224224        cert = createObject('waeup.Certificate')
    225225        cert.code = u'xyz'
    226         self.app['faculties']['JUPEB'] = Faculty(code=u'JUPEB')
    227         self.app['faculties']['JUPEB']['dep1'] = Department(code=u'dep1')
    228         self.app['faculties']['JUPEB']['dep1'].certificates.addCertificate(cert)
     226        self.app['faculties']['JUPEB123'] = Faculty(code=u'JUPEB123')
     227        self.app['faculties']['JUPEB123']['dep1'] = Department(code=u'dep1')
     228        self.app['faculties']['JUPEB123']['dep1'].certificates.addCertificate(cert)
    229229        self.student['studycourse'].certificate = cert
    230230        self.browser.open(self.student_path)
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r14898 r14902  
    263263            if p_item is None:
    264264                return _('Study course data are incomplete.'), None
    265             if student.faccode == 'JUPEB':
     265            if student.is_jupeb:
    266266                amount = 50000.0
    267267            elif student.faccode.startswith('FCETA'):
     
    279279            except (AttributeError, TypeError):
    280280                return _('Study course data are incomplete.'), None
    281 
    282             #####################################################
    283             #if student.faccode == 'JUPEB':
    284             #    return _('Payment temporarily disabled.'), None
    285             #####################################################
    286 
    287 
    288281            if previous_session:
    289282                # Students can pay for previous sessions in all workflow states.
  • main/waeup.uniben/trunk/src/waeup/uniben/students/viewlets.py

    r14835 r14902  
    122122    @property
    123123    def target_url(self):
    124         if self.context.flash_notice and self.context.faccode == 'JUPEB' \
     124        if self.context.flash_notice and self.context.is_jupeb \
    125125            and 'results' in self.context.flash_notice.lower():
    126126            return self.view.url(self.view.context, self.target)
Note: See TracChangeset for help on using the changeset viewer.