Changeset 15428 for main/waeup.aaue/trunk/src/waeup/aaue/students
- Timestamp:
- 27 May 2019, 06:00:21 (5 years ago)
- 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
r15424 r15428 457 457 return form_fields 458 458 459 class CustomUnregisterCoursesView(UnregisterCoursesView):460 """Unregister course list by student461 """462 grok.context(ICustomStudentStudyLevel)463 464 def update(self):465 if not self.context.__parent__.is_current:466 emit_lock_message(self)467 return468 try:469 deadline = grok.getSite()['configuration'][470 str(self.context.level_session)].coursereg_deadline471 except (TypeError, KeyError):472 deadline = None473 # In AAUE fresh students are allowed to "unregister their course"474 # aside the deadline475 if deadline and not self.context.student.is_fresh \476 and deadline < datetime.now(pytz.utc):477 self.flash(_(478 "Course registration has ended. "479 "Unregistration is disabled."), type="warning")480 elif str(self.context.__parent__.current_level) != self.context.__name__:481 self.flash(_('This is not your current level.'), type="danger")482 elif self.context.student.state == REGISTERED:483 IWorkflowInfo(self.context.student).fireTransition('reset7')484 message = _('Course list has been unregistered.')485 self.flash(message)486 else:487 self.flash(_('You are in the wrong state.'), type="warning")488 self.redirect(self.url(self.context))489 return459 #class CustomUnregisterCoursesView(UnregisterCoursesView): 460 # """Unregister course list by student 461 # """ 462 # grok.context(ICustomStudentStudyLevel) 463 464 # def update(self): 465 # if not self.context.__parent__.is_current: 466 # emit_lock_message(self) 467 # return 468 # try: 469 # deadline = grok.getSite()['configuration'][ 470 # str(self.context.level_session)].coursereg_deadline 471 # except (TypeError, KeyError): 472 # deadline = None 473 # # In AAUE fresh students are allowed to "unregister their course" 474 # # aside the deadline 475 # if deadline and not self.context.student.is_fresh \ 476 # and deadline < datetime.now(pytz.utc): 477 # self.flash(_( 478 # "Course registration has ended. " 479 # "Unregistration is disabled."), type="warning") 480 # elif str(self.context.__parent__.current_level) != self.context.__name__: 481 # self.flash(_('This is not your current level.'), type="danger") 482 # elif self.context.student.state == REGISTERED: 483 # IWorkflowInfo(self.context.student).fireTransition('reset7') 484 # message = _('Course list has been unregistered.') 485 # self.flash(message) 486 # else: 487 # self.flash(_('You are in the wrong state.'), type="warning") 488 # self.redirect(self.url(self.context)) 489 # return 490 490 491 491 class CustomStudyLevelDisplayFormPage(StudyLevelDisplayFormPage): -
main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py
r15412 r15428 151 151 if not restitution_paid: 152 152 return _("Please pay restitution fee first.") 153 if self.student.is_fresh:154 return153 #if self.student.is_fresh: 154 # return 155 155 try: 156 156 academic_session = grok.getSite()['configuration'][ -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r15414 r15428 689 689 # Reset student and check if fresh students are always allowed to 690 690 # register courses. 691 self.student['studycourse'].entry_session = 2004692 del self.student['payments'][self.student['payments'].keys()[1]]693 IWorkflowState(self.student).setState('school fee paid')694 self.browser.open(self.studycourse_path + '/100/edit')695 self.browser.getControl("Register course list").click()696 self.assertTrue('Course list has been registered' in self.browser.contents)691 #self.student['studycourse'].entry_session = 2004 692 #del self.student['payments'][self.student['payments'].keys()[1]] 693 #IWorkflowState(self.student).setState('school fee paid') 694 #self.browser.open(self.studycourse_path + '/100/edit') 695 #self.browser.getControl("Register course list").click() 696 #self.assertTrue('Course list has been registered' in self.browser.contents) 697 697 return 698 698
Note: See TracChangeset for help on using the changeset viewer.