Changeset 14733 for main/waeup.aaue/trunk
- Timestamp:
- 30 Jul 2017, 07:34:57 (7 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py
r14585 r14733 19 19 from hurry.workflow.interfaces import IWorkflowState 20 20 from zope.component import getUtility, createObject 21 from waeup.kofa.students.studylevel import StudentStudyLevel 21 22 from waeup.kofa.students.tests.test_browser import StudentsFullSetup 22 23 from waeup.kofa.students.interfaces import IStudentsUtils … … 139 140 140 141 def test_maxCreditsExceeded(self): 142 # non-final-year student 141 143 students_utils = getUtility(IStudentsUtils) 142 144 studylevel = grok.Container() 143 145 studylevel.total_credits = 30 146 studylevel.level = 100 147 self.student['studycourse']['100'] = studylevel 144 148 course = grok.Model() 145 149 course.credits = 18 -
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r14663 r14733 447 447 448 448 def warnCreditsOOR(self, studylevel, course=None): 449 if course and studylevel.total_credits + course.credits > 48: 449 studycourse = studylevel.__parent__ 450 certificate = getattr(studycourse,'certificate', None) 451 current_level = studycourse.current_level 452 if None in (current_level, certificate): 453 return 454 end_level = certificate.end_level 455 if current_level >= end_level: 456 limit = 52 457 else: 458 limit = 48 459 if course and studylevel.total_credits + course.credits > limit: 450 460 return _('Maximum credits exceeded.') 451 elif studylevel.total_credits > 48:461 elif studylevel.total_credits > limit: 452 462 return _('Maximum credits exceeded.') 453 463 return
Note: See TracChangeset for help on using the changeset viewer.