- Timestamp:
- 13 Apr 2015, 11:25:52 (10 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r12844 r12853 4 4 1.3.2.dev0 (unreleased) 5 5 ======================= 6 7 * Students are only allowed to download course registration slips if they are 8 in state 'registered' and their current level corresponds with the course 9 registration level. 6 10 7 11 * Add ReportsManager role. -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r12807 r12853 1359 1359 'adm_code', 'sex', 'suspended_comment', 'current_level') 1360 1360 1361 1362 def update(self): 1363 if self.context.student.state != REGISTERED \ 1364 or self.context.student.current_level != self.context.level: 1365 self.flash(_('Forbidden'), type="warning") 1366 self.redirect(self.url(self.context)) 1367 1361 1368 @property 1362 1369 def title(self): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r12847 r12853 2478 2478 self.assertTrue( 2479 2479 self.student['studycourse']['200']['COURSE1'].carry_over is True) 2480 # Students can open the pdf course registration slip2481 self.browser.open(self.student_path + '/studycourse/200')2482 self.browser.getLink("Download course registration slip").click()2483 self.assertEqual(self.browser.headers['Status'], '200 Ok')2484 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')2485 2480 # Students can remove course tickets 2486 2481 self.browser.open(self.student_path + '/studycourse/200/edit') … … 2517 2512 self.assertTrue('K1000000 - students.browser.StudyLevelEditFormPage - ' 2518 2513 'K1000000 - added: COURSE1|200|2004' in logcontent) 2514 # Students can't open the pdf course registration slip right 2515 self.assertFalse( 2516 'Download course registration slip' in self.browser.contents) 2517 self.browser.open( 2518 self.student_path + '/studycourse/200/course_registration_slip.pdf') 2519 self.assertTrue('Forbidden' in self.browser.contents) 2519 2520 # Course list can be registered 2521 self.browser.open(self.student_path + '/studycourse/200/edit') 2520 2522 self.browser.getControl("Register course list").click() 2521 2523 self.assertTrue('Course list has been registered' in self.browser.contents) 2522 2524 self.assertEqual(self.student.state, 'courses registered') 2525 # and students can open the pdf course registration slip right 2526 self.browser.getLink("Download course registration slip").click() 2527 self.assertEqual(self.browser.headers['Status'], '200 Ok') 2528 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 2529 # Students can't view the download link if current_session 2530 # does not correspond with level_session. 2531 self.student['studycourse'].current_level = 300 2532 self.browser.open(self.student_path + '/studycourse/200/edit') 2533 self.assertFalse( 2534 'Download course registration slip' in self.browser.contents) 2535 self.assertFalse( 2536 'Download course registration slip' in self.browser.contents) 2537 self.browser.open( 2538 self.student_path + '/studycourse/200/course_registration_slip.pdf') 2539 self.assertTrue('Forbidden' in self.browser.contents) 2523 2540 # Students can view the transcript 2524 2541 #self.browser.open(self.studycourse_path) -
main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
r12843 r12853 453 453 if not is_current: 454 454 return '' 455 if self.context.student.state != REGISTERED \ 456 or self.context.student.current_level != self.context.level: 457 return '' 455 458 return self.view.url(self.view.context, self.target) 456 459
Note: See TracChangeset for help on using the changeset viewer.