Changeset 9139 for main/waeup.kofa/trunk


Ignore:
Timestamp:
1 Sep 2012, 05:34:11 (12 years ago)
Author:
Henrik Bettermann
Message:

Lock esit and add views for old study courses.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
2 edited

Legend:

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

    r9138 r9139  
    714714
    715715    def update(self):
     716        if not self.context.is_current:
     717            emit_lock_message(self)
     718            return
    716719        super(StudyCourseManageFormPage, self).update()
    717720        tabs.need()
     
    916919
    917920    def update(self):
     921        if not self.context.__parent__.is_current:
     922            emit_lock_message(self)
     923            return
    918924        super(StudyLevelManageFormPage, self).update()
    919925        tabs.need()
     
    978984
    979985    def update(self):
     986        if not self.context.__parent__.is_current:
     987            emit_lock_message(self)
     988            return
    980989        if str(self.context.__parent__.current_level) != self.context.__name__:
    981990            self.flash(_('This level does not correspond current level.'))
     
    10001009
    10011010    def update(self):
     1011        if not self.context.__parent__.is_current:
     1012            emit_lock_message(self)
     1013            return
    10021014        if str(self.context.__parent__.current_level) != self.context.__name__:
    10031015            self.flash(_('This level does not correspond current level.'))
     
    10341046        'score', 'automatic', 'carry_over')
    10351047    pnav = 4
     1048
     1049    def update(self):
     1050        if not self.context.__parent__.is_current:
     1051            emit_lock_message(self)
     1052            return
     1053        super(CourseTicketAddFormPage, self).update()
     1054        return
    10361055
    10371056    @action(_('Add course ticket'))
     
    17981817
    17991818    def update(self, SUBMIT=None):
     1819        if not self.context.is_current:
     1820            emit_lock_message(self)
     1821            return
     1822        super(StartSessionPage, self).update()
    18001823        if not self.context.next_session_allowed:
    18011824            self.flash(_("You are not entitled to start session."))
     
    18551878
    18561879    def update(self):
     1880        if not self.context.is_current:
     1881            emit_lock_message(self)
     1882            return
    18571883        if self.context.student.state != PAID:
    18581884            emit_lock_message(self)
     
    18871913
    18881914    def update(self):
     1915        if not self.context.__parent__.is_current:
     1916            emit_lock_message(self)
     1917            return
    18891918        if self.context.student.state != PAID:
    18901919            emit_lock_message(self)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r9138 r9139  
    19581958            self.certificate2)
    19591959
     1960        # Add study level to old study course
     1961        studylevel = createObject(u'waeup.StudentStudyLevel')
     1962        studylevel.level = 200
     1963        self.student['studycourse'].addStudentStudyLevel(
     1964            self.certificate, studylevel)
     1965
    19601966        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    19611967        self.browser.open(self.student_path)
     
    19711977        self.browser.getControl("Transfer").click()
    19721978        self.assertTrue('Successfully transferred' in self.browser.contents)
     1979
     1980        # Add study level to new study course
     1981        studylevel = createObject(u'waeup.StudentStudyLevel')
     1982        studylevel.level = 200
     1983        self.student['studycourse'].addStudentStudyLevel(
     1984            self.certificate, studylevel)
     1985
     1986        # Edit and add pages are locked for old study courses
     1987        self.browser.open(self.student_path + '/studycourse/manage')
     1988        self.assertFalse('The requested form is locked' in self.browser.contents)
     1989        self.browser.open(self.student_path + '/studycourse_1/manage')
     1990        self.assertTrue('The requested form is locked' in self.browser.contents)
     1991
     1992        self.browser.open(self.student_path + '/studycourse/start_session')
     1993        self.assertFalse('The requested form is locked' in self.browser.contents)
     1994        self.browser.open(self.student_path + '/studycourse_1/start_session')
     1995        self.assertTrue('The requested form is locked' in self.browser.contents)
     1996
     1997        IWorkflowState(self.student).setState('school fee paid')
     1998        self.browser.open(self.student_path + '/studycourse/add')
     1999        self.assertFalse('The requested form is locked' in self.browser.contents)
     2000        self.browser.open(self.student_path + '/studycourse_1/add')
     2001        self.assertTrue('The requested form is locked' in self.browser.contents)
     2002
     2003        self.browser.open(self.student_path + '/studycourse/200/manage')
     2004        self.assertFalse('The requested form is locked' in self.browser.contents)
     2005        self.browser.open(self.student_path + '/studycourse_1/200/manage')
     2006        self.assertTrue('The requested form is locked' in self.browser.contents)
     2007
     2008        self.browser.open(self.student_path + '/studycourse/200/validate_courses')
     2009        self.assertFalse('The requested form is locked' in self.browser.contents)
     2010        self.browser.open(self.student_path + '/studycourse_1/200/validate_courses')
     2011        self.assertTrue('The requested form is locked' in self.browser.contents)
     2012
     2013        self.browser.open(self.student_path + '/studycourse/200/reject_courses')
     2014        self.assertFalse('The requested form is locked' in self.browser.contents)
     2015        self.browser.open(self.student_path + '/studycourse_1/200/reject_courses')
     2016        self.assertTrue('The requested form is locked' in self.browser.contents)
     2017
     2018        self.browser.open(self.student_path + '/studycourse/200/add')
     2019        self.assertFalse('The requested form is locked' in self.browser.contents)
     2020        self.browser.open(self.student_path + '/studycourse_1/200/add')
     2021        self.assertTrue('The requested form is locked' in self.browser.contents)
     2022
     2023        self.browser.open(self.student_path + '/studycourse/200/edit')
     2024        self.assertFalse('The requested form is locked' in self.browser.contents)
     2025        self.browser.open(self.student_path + '/studycourse_1/200/edit')
     2026        self.assertTrue('The requested form is locked' in self.browser.contents)
    19732027
    19742028class StudentRequestPWTests(StudentsFullSetup):
Note: See TracChangeset for help on using the changeset viewer.