Index: main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py
===================================================================
--- main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py	(revision 15460)
+++ main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py	(revision 15461)
@@ -406,35 +406,44 @@
         return form_fields
 
-#class CustomUnregisterCoursesView(UnregisterCoursesView):
-#    """Unregister course list by student
-#    """
-#    grok.context(ICustomStudentStudyLevel)
-
-#    def update(self):
-#        if not self.context.__parent__.is_current:
-#            emit_lock_message(self)
-#            return
-#        try:
-#            deadline = grok.getSite()['configuration'][
-#                str(self.context.level_session)].coursereg_deadline
-#        except (TypeError, KeyError):
-#            deadline = None
-#        # In AAUE fresh students are allowed to "unregister their course"
-#        # aside the deadline
-#        if deadline and not self.context.student.is_fresh \
-#            and deadline < datetime.now(pytz.utc):
-#            self.flash(_(
-#                "Course registration has ended. "
-#                "Unregistration is disabled."), type="warning")
-#        elif str(self.context.__parent__.current_level) != self.context.__name__:
-#            self.flash(_('This is not your current level.'), type="danger")
-#        elif self.context.student.state == REGISTERED:
-#            IWorkflowInfo(self.context.student).fireTransition('reset7')
-#            message = _('Course list has been unregistered.')
-#            self.flash(message)
-#        else:
-#            self.flash(_('You are in the wrong state.'), type="warning")
-#        self.redirect(self.url(self.context))
-#        return
+class CustomUnregisterCoursesView(UnregisterCoursesView):
+    """Unregister course list by student
+    """
+    grok.context(ICustomStudentStudyLevel)
+
+    def update(self):
+        if not self.context.__parent__.is_current:
+            emit_lock_message(self)
+            return
+        try:
+            academic_session = grok.getSite()['configuration'][
+                str(self.context.level_session)]
+            if self.context.student.is_postgrad:
+                deadline = academic_session.coursereg_deadline_pg
+            elif self.context.student.current_mode.startswith('dp'):
+                deadline = academic_session.coursereg_deadline_dp
+            elif self.context.student.current_mode.endswith('_pt'):
+                deadline = academic_session.coursereg_deadline_pt
+            elif self.context.student.current_mode == 'found':
+                deadline = academic_session.coursereg_deadline_found
+            elif self.context.student.current_mode == 'bridge':
+                deadline = academic_session.coursereg_deadline_bridge
+            else:
+                deadline = academic_session.coursereg_deadline
+        except (TypeError, KeyError):
+            deadline = None
+        if deadline and deadline < datetime.now(pytz.utc):
+            self.flash(_(
+                "Course registration has ended. "
+                "Unregistration is disabled."), type="danger")
+        elif str(self.context.__parent__.current_level) != self.context.__name__:
+            self.flash(_('This is not your current level.'), type="danger")
+        elif self.context.student.state == REGISTERED:
+            IWorkflowInfo(self.context.student).fireTransition('reset7')
+            message = _('Course list has been unregistered.')
+            self.flash(message)
+        else:
+            self.flash(_('You are in the wrong state.'), type="warning")
+        self.redirect(self.url(self.context))
+        return
 
 class CustomStudyLevelDisplayFormPage(StudyLevelDisplayFormPage):
