Commit aa378198 by Andy Armstrong

Add bulk operations around CourseTabView rendering

parent e2c81835
...@@ -495,11 +495,12 @@ class CourseTabView(EdxFragmentView): ...@@ -495,11 +495,12 @@ class CourseTabView(EdxFragmentView):
Displays a course tab page that contains a web fragment. Displays a course tab page that contains a web fragment.
""" """
course_key = CourseKey.from_string(course_id) course_key = CourseKey.from_string(course_id)
course = get_course_with_access(request.user, 'load', course_key) with modulestore().bulk_operations(course_key):
tab = CourseTabList.get_tab_by_type(course.tabs, tab_type) course = get_course_with_access(request.user, 'load', course_key)
page_context = self.create_page_context(request, course=course, tab=tab, **kwargs) tab = CourseTabList.get_tab_by_type(course.tabs, tab_type)
set_custom_metrics_for_course_key(course_key) page_context = self.create_page_context(request, course=course, tab=tab, **kwargs)
return super(CourseTabView, self).get(request, course=course, page_context=page_context, **kwargs) set_custom_metrics_for_course_key(course_key)
return super(CourseTabView, self).get(request, course=course, page_context=page_context, **kwargs)
def create_page_context(self, request, course=None, tab=None, **kwargs): def create_page_context(self, request, course=None, tab=None, **kwargs):
""" """
......
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