Changeset 8482


Ignore:
Timestamp:
21 May 2012, 10:01:03 (13 years ago)
Author:
Henrik Bettermann
Message:

next_session_allowed is False if certificate is None.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/students/studycourse.py

    r8474 r8482  
    3939    def next_session_allowed(self):
    4040        state = self.getStudent().state
     41        certificate = getattr(self, 'certificate', None)
     42        if certificate == None:
     43            return False
    4144        if state == CLEARED:
    4245            return True
     
    4548            'A','B','C','F','J','L','M','N','O','X','Z')
    4649        cond2 = self.current_level in (0, 100)
    47         cond3 = self.getStudent().current_mode.startswith('de') and \
     50        cond3 = certificate.study_mode.startswith('de') and \
    4851            self.current_level == 200
    49         cond4 = self.getStudent().current_mode.startswith('ph') and \
     52        cond4 = certificate.study_mode.startswith('ph') and \
    5053            self.current_level == 300
    5154        if cond0 and (cond1 or cond2 or cond3 or cond4):
    5255            return True
    5356        cond5 = self.is_postgrad
    54         cond6 = self.getStudent().state == PAID
     57        cond6 = state == PAID
    5558        if  cond5 and cond6:
    5659            return True
Note: See TracChangeset for help on using the changeset viewer.