Commit 9ce9b6f9 by Bill Filler

fix issue with dynamic tabs, get rid of hijack of Discussions Tab

parent 95635749
......@@ -101,12 +101,10 @@ class DigitalLockerTab(TabFragmentViewMixin, EnrolledTab):
# view_name = 'openedx.course_experience.digital_locker_fragment'
fragment_view_name = 'openedx.features.course_experience.views.digital_locker_fragment.DigitalLockerFragmentView'
allow_multiple = False
#is_dynamic = True
is_default = False
is_dynamic = True
@classmethod
def is_enabled(cls, course, user=None):
return False
return True
class ProgressTab(EnrolledTab):
"""
......@@ -346,8 +344,6 @@ def get_course_tab_list(request, course):
if tab.type == 'static_tab' and tab.course_staff_only and \
not bool(user and has_access(user, 'staff', course, course.id)):
continue
if tab.type == 'discussion':
tab.name = 'Digital Locker'
course_tab_list.append(tab)
# Add in any dynamic tabs, i.e. those that are not persisted
......
......@@ -61,6 +61,7 @@ from eventtracking import tracker
from ipware.ip import get_ip
from lms.djangoapps.ccx.custom_exception import CCXLocatorValidationException
from lms.djangoapps.courseware.exceptions import CourseAccessRedirect, Redirect
from lms.djangoapps.courseware.tabs import get_course_tab_list
from lms.djangoapps.experiments.utils import get_experiment_user_metadata_context
from lms.djangoapps.grades.course_grade_factory import CourseGradeFactory
from lms.djangoapps.instructor.enrollment import uses_shib
......@@ -464,7 +465,8 @@ class CourseTabView(EdxFragmentView):
course = get_course_with_access(request.user, 'load', course_key)
try:
# Render the page
tab = CourseTabList.get_tab_by_type(course.tabs, tab_type)
course_tabs = get_course_tab_list(request, course)
tab = CourseTabList.get_tab_by_type(course_tabs, tab_type)
page_context = self.create_page_context(request, course=course, tab=tab, **kwargs)
# Show warnings if the user has limited access
......
......@@ -16,11 +16,10 @@ class DiscussionTab(TabFragmentViewMixin, EnrolledTab):
"""
type = 'discussion'
title = 'Digital Locker'
title = 'Discussion'
priority = None
view_name = 'discussion.views.forum_form_discussion'
# fragment_view_name = 'discussion.views.DiscussionBoardFragmentView'
fragment_view_name = 'openedx.features.course_experience.views.digital_locker_fragment.DigitalLockerFragmentView'
fragment_view_name = 'discussion.views.DiscussionBoardFragmentView'
is_hideable = settings.FEATURES.get('ALLOW_HIDING_DISCUSSION_TAB', False)
is_default = False
body_class = 'discussion'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment