Changeset 13051


Ignore:
Timestamp:
15 Jun 2015, 15:04:19 (10 years ago)
Author:
Henrik Bettermann
Message:

Student are always allowed to download course registration slips of passed sessions.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/students
Files:
3 edited

Legend:

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

    r13038 r13051  
    108108    def update(self):
    109109        if self.context.student.state != REGISTERED \
    110             or self.context.student.current_level != self.context.level:
     110            and self.context.student.current_level == self.context.level:
    111111            self.flash(_('Forbidden'), type="warning")
    112112            self.redirect(self.url(self.context))
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r13043 r13051  
    421421
    422422    def test_student_course_registration(self):
    423         # Uniben students see grade instead of score on all level pages
    424         # and on course ticket page.
    425423        IWorkflowState(self.student).setState('school fee paid')
    426424        self.browser.open(self.login_path)
     
    434432                           self.browser.contents)
    435433        self.browser.getControl("Create course list now").click()
    436         # Students can open the customized pdf course registration slip
    437         # if they have registered their course list
     434        # Students can't open the customized pdf course registration slip
    438435        self.browser.open(
    439436            self.student_path + '/studycourse/100/course_registration_slip.pdf')
    440437        self.assertTrue('Forbidden' in self.browser.contents)
     438        # They can open slips from the previous session ...
     439        self.student['studycourse'].current_level = 200
     440        self.browser.open(self.student_path + '/studycourse/100')
     441        self.browser.getLink("Download course registration slip").click()
     442        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     443        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
     444        # or if they have registered their course list
     445        self.student['studycourse'].current_level = 200
    441446        IWorkflowState(self.student).setState('courses registered')
    442447        self.browser.open(self.student_path + '/studycourse/100')
  • main/waeup.aaue/trunk/src/waeup/aaue/students/viewlets.py

    r13039 r13051  
    9393            return ''
    9494        if self.context.student.state != REGISTERED \
    95             or self.context.student.current_level != self.context.level:
     95            and self.context.student.current_level == self.context.level:
    9696            return ''
    9797        return self.view.url(self.view.context, self.target)
Note: See TracChangeset for help on using the changeset viewer.