diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index a9e2602307..6f428ee3e8 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -247,7 +247,7 @@ def load_preview_module(request, preview_id, descriptor, instance_state, shared_ module = descriptor.xmodule_constructor(system)(instance_state, shared_state) module.get_html = replace_static_urls( wrap_xmodule(module.get_html, module, "xmodule_display.html"), - module.metadata['data_dir'], module + module.metadata['data_dir'] ) save_preview_state(request, preview_id, descriptor.location.url(), module.get_instance_state(), module.get_shared_state()) diff --git a/common/djangoapps/xmodule_modifiers.py b/common/djangoapps/xmodule_modifiers.py index 80514cf8d4..7ea6778af6 100644 --- a/common/djangoapps/xmodule_modifiers.py +++ b/common/djangoapps/xmodule_modifiers.py @@ -35,7 +35,7 @@ def wrap_xmodule(get_html, module, template): return _get_html -def replace_course_urls(get_html, course_id, module): +def replace_course_urls(get_html, course_id): """ Updates the supplied module with a new get_html function that wraps the old get_html function and substitutes urls of the form /course/... @@ -46,7 +46,7 @@ def replace_course_urls(get_html, course_id, module): return replace_urls(get_html(), staticfiles_prefix='/courses/'+course_id, replace_prefix='/course/') return _get_html -def replace_static_urls(get_html, prefix, module): +def replace_static_urls(get_html, prefix): """ Updates the supplied module with a new get_html function that wraps the old get_html function and substitutes urls of the form /static/... diff --git a/lms/djangoapps/courseware/module_render.py b/lms/djangoapps/courseware/module_render.py index b033660c17..a65d73e4bc 100644 --- a/lms/djangoapps/courseware/module_render.py +++ b/lms/djangoapps/courseware/module_render.py @@ -254,12 +254,11 @@ def _get_module(user, request, location, student_module_cache, course_id, positi module.get_html = replace_static_urls( wrap_xmodule(module.get_html, module, 'xmodule_display.html'), - module.metadata['data_dir'], module - ) + module.metadata['data_dir']) # Allow URLs of the form '/course/' refer to the root of multicourse directory # hierarchy of this course - module.get_html = replace_course_urls(module.get_html, course_id, module) + module.get_html = replace_course_urls(module.get_html, course_id) if settings.MITX_FEATURES.get('DISPLAY_HISTOGRAMS_TO_STAFF'): if has_access(user, module, 'staff'):