Changeset 12855 for main/waeup.uniben/trunk/src/waeup/uniben
- Timestamp:
- 13 Apr 2015, 14:55:28 (10 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py
r12852 r12855 255 255 'level_verdict', 'gpa') 256 256 257 def update(self): 258 if self.context.student.state != REGISTERED \ 259 or self.context.student.current_level != self.context.level: 260 self.flash(_('Forbidden'), type="warning") 261 self.redirect(self.url(self.context)) 262 257 263 @property 258 264 def tabletitle(self): -
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r12846 r12855 366 366 self.browser.getLink("COURSE1").click() 367 367 self.assertFalse('Score' in self.browser.contents) 368 # Students can open the customized pdf course registration slip369 self.browser.open(self.student_path + '/studycourse/100')370 self.browser.getLink("Download course registration slip").click()371 self.assertEqual(self.browser.headers['Status'], '200 Ok')372 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')373 368 # Students can open the special Uniben pdf course result slip 374 369 self.browser.open(self.student_path + '/studycourse/100') … … 384 379 self.browser.getControl("Remove selected", index=0).click() 385 380 self.assertTrue('Successfully removed' in self.browser.contents) 381 # Students can open the customized pdf course registration slip 382 # if they have registered their course list 383 self.browser.open( 384 self.student_path + '/studycourse/100/course_registration_slip.pdf') 385 self.assertTrue('Forbidden' in self.browser.contents) 386 IWorkflowState(self.student).setState('courses registered') 387 self.browser.open(self.student_path + '/studycourse/100') 388 self.browser.getLink("Download course registration slip").click() 389 self.assertEqual(self.browser.headers['Status'], '200 Ok') 390 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 386 391 387 392 def test_get_returning_data(self): -
main/waeup.uniben/trunk/src/waeup/uniben/students/viewlets.py
r12452 r12855 18 18 19 19 import grok 20 from waeup.kofa.interfaces import REQUESTED 20 from waeup.kofa.interfaces import REQUESTED, REGISTERED 21 21 from waeup.kofa.browser.viewlets import ManageActionButton 22 22 from waeup.uniben.students.interfaces import ( … … 44 44 return self.view.url(self.view.context, self.target) 45 45 return False 46 47 class CourseRegistrationSlipActionButton(ManageActionButton): 48 grok.order(5) 49 grok.context(ICustomStudentStudyLevel) 50 grok.view(StudyLevelDisplayFormPage) 51 grok.require('waeup.viewStudent') 52 icon = 'actionicon_pdf.png' 53 text = _('Download course registration slip') 54 target = 'course_registration_slip.pdf' 55 56 @property 57 def target_url(self): 58 is_current = self.context.__parent__.is_current 59 if not is_current: 60 return '' 61 if self.context.student.state != REGISTERED \ 62 or self.context.student.current_level != self.context.level: 63 return '' 64 return self.view.url(self.view.context, self.target) 46 65 47 66 class CourseResultSlipActionButton(ManageActionButton):
Note: See TracChangeset for help on using the changeset viewer.