Ignore:
Timestamp:
6 Mar 2020, 19:56:56 (5 years ago)
Author:
Henrik Bettermann
Message:
  • Bugfix: If level_session of a studylevel object has changed, coursetickets_catalog must be informed. Otherwise lecturers don't see their students.
Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
2 edited

Legend:

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

    r16024 r16027  
    2727from zope.component import createObject, queryUtility, getUtility
    2828from zope.interface import implementedBy
     29from zope.event import notify
    2930from waeup.kofa.interfaces import academic_sessions_vocab, VALIDATED, IKofaUtils
    3031from waeup.kofa.students.interfaces import (
     
    3334from waeup.kofa.students.vocabularies import StudyLevelSource
    3435from waeup.kofa.interfaces import MessageFactory as _
     36
     37@grok.subscribe(IStudentStudyLevel, grok.IObjectModifiedEvent)
     38def handle_update_coursetickets(studylevel, event):
     39    """If level_session has changed, coursetickets_catalog
     40    must be informed.
     41    """
     42    # Catalog must be informed
     43    for ticket in studylevel.values():
     44        notify(grok.ObjectModifiedEvent(ticket))
     45    return
    3546
    3647def find_carry_over(ticket):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r16007 r16027  
    44744474        self.app['users']['mrslecturer'].title = u'Mercedes Benz'
    44754475        # Add course ticket
    4476         studylevel = createObject(u'waeup.StudentStudyLevel')
    4477         studylevel.level = 100
    4478         studylevel.level_session = 2004
     4476        self.studylevel = createObject(u'waeup.StudentStudyLevel')
     4477        self.studylevel.level = 100
     4478        self.studylevel.level_session = 2004
    44794479        self.student['studycourse'].addStudentStudyLevel(
    4480             self.certificate, studylevel)
     4480            self.certificate, self.studylevel)
    44814481        # Assign local Lecturer role for a course.
    44824482        course = self.app['faculties']['fac1']['dep1'].courses['COURSE1']
     
    46264626        self.assertTrue(
    46274627            self.browser.getControl(name="scores:list") is not None)
     4628        # if level_session of studycourse changes, catalog has been updated
     4629        # and student disappears
     4630        self.studylevel.level_session = 2005
     4631        self.browser.reload()
     4632        self.assertRaises(
     4633            LookupError, self.browser.getControl, name="scores")
    46284634
    46294635    def test_score_editing_can_change_scores(self):
Note: See TracChangeset for help on using the changeset viewer.