Ignore:
Timestamp:
19 Oct 2012, 16:29:59 (12 years ago)
Author:
Henrik Bettermann
Message:

CustomStudentStudyCourse? should inherit from NigeriaStudentStudyCourse?.

File:
1 edited

Legend:

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

    r9351 r9359  
    2222import grok
    2323from zope.interface import implementedBy
    24 from waeup.kofa.students.studycourse import (
    25     StudentStudyCourse, StudentStudyCourseFactory)
     24from waeup.kofa.students.studycourse import StudentStudyCourseFactory
    2625from waeup.kofa.utils.helpers import attrs_to_fields
    2726from waeup.kofa.students.interfaces import IStudentNavigation
    2827from waeup.kofa.students.workflow import CLEARED, RETURNING, PAID
     28from kofacustom.nigeria.students.studycourse import NigeriaStudentStudyCourse
    2929from waeup.futminna.students.interfaces import ICustomStudentStudyCourse
    3030
    31 class CustomStudentStudyCourse(StudentStudyCourse):
     31class CustomStudentStudyCourse(NigeriaStudentStudyCourse):
    3232    """This is a container for study levels.
    3333    """
    34 
    3534    grok.implements(ICustomStudentStudyCourse, IStudentNavigation)
    3635    grok.provides(ICustomStudentStudyCourse)
    37 
    38     @property
    39     def next_session_allowed(self):
    40         state = self.student.state
    41         certificate = getattr(self, 'certificate', None)
    42         if certificate == None:
    43             return False
    44         if state == CLEARED:
    45             return True
    46         cond0 = state == RETURNING
    47         cond1 = self.current_verdict in (
    48             'A','B','C','F','J','L','M','N','O','X','Z')
    49         cond2 = self.current_level in (0, 100)
    50         cond3 = certificate.study_mode.startswith('de') and \
    51             self.current_level == 200
    52         cond4 = certificate.study_mode.startswith('ph') and \
    53             self.current_level == 300
    54         if cond0 and (cond1 or cond2 or cond3 or cond4):
    55             return True
    56         cond5 = self.is_postgrad
    57         cond6 = state == PAID
    58         if  cond5 and cond6:
    59             return True
    60         return False
    6136
    6237CustomStudentStudyCourse = attrs_to_fields(CustomStudentStudyCourse)
Note: See TracChangeset for help on using the changeset viewer.