Ignore:
Timestamp:
27 May 2019, 06:00:21 (5 years ago)
Author:
Henrik Bettermann
Message:

Students whose entry session = 2018 will NO LONGER be able to register and unregister their course forms for 2018/2019 session (ticket #562)

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  
    457457        return form_fields
    458458
    459 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
     459#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
    490490
    491491class CustomStudyLevelDisplayFormPage(StudyLevelDisplayFormPage):
  • main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py

    r15412 r15428  
    151151        if not restitution_paid:
    152152            return _("Please pay restitution fee first.")
    153         if self.student.is_fresh:
    154             return
     153        #if self.student.is_fresh:
     154        #    return
    155155        try:
    156156            academic_session = grok.getSite()['configuration'][
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r15414 r15428  
    689689        # Reset student and check if fresh students are always allowed to
    690690        # register courses.
    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)
     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)
    697697        return
    698698
Note: See TracChangeset for help on using the changeset viewer.