Merge pull request #3725 from carsongee/cg/transcript_xmlmodulestore_fix
Fix bug affecting video transcripts in XMLModulesStore courses
This commit is contained in:
@@ -195,12 +195,21 @@ class VideoStudentViewHandlers(object):
|
||||
|
||||
if transcript_name:
|
||||
course_location = CourseDescriptor.id_to_location(self.course_id)
|
||||
course = self.descriptor.runtime.modulestore.get_item(course_location)
|
||||
if course.static_asset_path:
|
||||
|
||||
# Get the asset path for course
|
||||
asset_path = None
|
||||
if hasattr(self.descriptor.runtime, 'modulestore'):
|
||||
course = self.descriptor.runtime.modulestore.get_item(course_location)
|
||||
asset_path = course.static_asset_path
|
||||
else:
|
||||
# Handle XML Courses that don't have modulestore in the runtime
|
||||
asset_path = getattr(self.descriptor, 'data_dir', None)
|
||||
|
||||
if asset_path:
|
||||
response = Response(
|
||||
status=307,
|
||||
location='/static/{0}/{1}'.format(
|
||||
course.static_asset_path,
|
||||
asset_path,
|
||||
subs_filename(transcript_name, self.transcript_language)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user