Pass a course to get_section
This commit is contained in:
@@ -141,7 +141,7 @@ def toc_for_course(user, request, course, active_chapter, active_section):
|
||||
return chapters
|
||||
|
||||
|
||||
def get_section(course, chapter, section):
|
||||
def get_section(course_module, chapter, section):
|
||||
"""
|
||||
Returns the xmodule descriptor for the name course > chapter > section,
|
||||
or None if this doesn't specify a valid section
|
||||
@@ -150,11 +150,6 @@ def get_section(course, chapter, section):
|
||||
chapter: Chapter name
|
||||
section: Section name
|
||||
"""
|
||||
try:
|
||||
course_module = modulestore().get_item(course)
|
||||
except:
|
||||
log.exception("Unable to load course_module")
|
||||
return None
|
||||
|
||||
if course_module is None:
|
||||
return
|
||||
|
||||
@@ -190,7 +190,8 @@ def index(request, course_id=None, chapter=None, section=None,
|
||||
look_for_module = chapter is not None and section is not None
|
||||
if look_for_module:
|
||||
# TODO (cpennington): Pass the right course in here
|
||||
section = get_section(course_location, chapter, section)
|
||||
|
||||
section = get_section(course, chapter, section)
|
||||
student_module_cache = StudentModuleCache(request.user, section)
|
||||
module, _, _, _ = get_module(request.user, request, section.location, student_module_cache)
|
||||
context['content'] = module.get_html()
|
||||
|
||||
Reference in New Issue
Block a user