Changeset 13610 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 13 Jan 2016, 20:59:17 (9 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r13574 r13610 1513 1513 return 1514 1514 if str(self.context.__parent__.current_level) != self.context.__name__: 1515 self.flash(_('This level does not correspondcurrent level.'),1515 self.flash(_('This is not the student\'s current level.'), 1516 1516 type="danger") 1517 1517 elif self.context.student.state == REGISTERED: … … 1539 1539 return 1540 1540 if str(self.context.__parent__.current_level) != self.context.__name__: 1541 self.flash(_('This level does not correspondcurrent level.'),1541 self.flash(_('This is not the student\'s current level.'), 1542 1542 type="danger") 1543 1543 self.redirect(self.url(self.context)) … … 1549 1549 elif self.context.student.state == REGISTERED: 1550 1550 IWorkflowInfo(self.context.student).fireTransition('reset7') 1551 message = _('Course list request has been rejected.')1551 message = _('Course list has been unregistered.') 1552 1552 self.flash(message) 1553 1553 else: … … 1558 1558 self.redirect(self.url(self.context.student) + 1559 1559 '/contactstudent?%s' % urlencode(args)) 1560 return 1561 1562 def render(self): 1563 return 1564 1565 class UnregisterCoursesView(UtilityView, grok.View): 1566 """Unegister course list by student 1567 """ 1568 grok.context(IStudentStudyLevel) 1569 grok.name('unregister_courses') 1570 grok.require('waeup.handleStudent') 1571 1572 def update(self): 1573 if not self.context.__parent__.is_current: 1574 emit_lock_message(self) 1575 return 1576 elif not self.context.course_registration_allowed: 1577 self.flash(_( 1578 "Course registration has ended. " 1579 "Unregistration is disabled."), type="warning") 1580 elif str(self.context.__parent__.current_level) != self.context.__name__: 1581 self.flash(_('This is not your current level.'), type="danger") 1582 elif self.context.student.state == REGISTERED: 1583 IWorkflowInfo(self.context.student).fireTransition('reset7') 1584 message = _('Course list has been unregistered.') 1585 self.flash(message) 1586 else: 1587 self.flash(_('You are in the wrong state.'), type="warning") 1588 self.redirect(self.url(self.context)) 1560 1589 return 1561 1590 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r13574 r13610 1748 1748 self.browser.open(L110_student_path) 1749 1749 self.browser.getLink("Reject courses").click() 1750 self.assertTrue('Course list request has been rejected'1750 self.assertTrue('Course list has been unregistered' 1751 1751 in self.browser.contents) 1752 1752 self.assertTrue('school fee paid' in self.browser.contents) … … 2627 2627 self.assertTrue('Course list has been registered' in self.browser.contents) 2628 2628 self.assertEqual(self.student.state, 'courses registered') 2629 # Course list can be unregistered 2630 self.browser.getLink("Unregister courses").click() 2631 self.assertEqual(self.student.state, 'school fee paid') 2632 self.assertTrue('Course list has been unregistered' in self.browser.contents) 2633 self.browser.open(self.student_path + '/studycourse/200/unregister_courses') 2634 self.assertTrue('You are in the wrong state' in self.browser.contents) 2629 2635 # Students can view the transcript 2630 2636 #self.browser.open(self.studycourse_path) -
main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
r13457 r13610 439 439 return self.view.url(self.view.context, self.target) 440 440 441 class StudentUnregisterCoursesActionButton(ManageActionButton): 442 grok.order(5) 443 grok.context(IStudentStudyLevel) 444 grok.view(StudyLevelDisplayFormPage) 445 grok.require('waeup.handleStudent') 446 text = _('Unregister courses') 447 target = 'unregister_courses' 448 icon = 'actionicon_reject.png' 449 450 @property 451 def target_url(self): 452 is_current = self.context.__parent__.is_current 453 if self.context.student.state != REGISTERED or \ 454 str(self.context.__parent__.current_level) != self.context.__name__ or\ 455 not is_current: 456 return '' 457 return self.view.url(self.view.context, self.target) 458 441 459 class CourseRegistrationSlipActionButton(ManageActionButton): 442 grok.order( 5)460 grok.order(6) 443 461 grok.context(IStudentStudyLevel) 444 462 grok.view(StudyLevelDisplayFormPage) -
main/waeup.kofa/trunk/src/waeup/kofa/students/workflow.py
r13103 r13610 151 151 Transition( 152 152 transition_id = 'reset7', 153 title = _(' Reset to school fee paid'),154 msg = _(" Reset to 'school fee paid'"),153 title = _('Unregister courses'), 154 msg = _("Courses unregistered"), 155 155 source = REGISTERED, 156 156 destination = PAID),
Note: See TracChangeset for help on using the changeset viewer.