Map '/course/' urls to the course's root in the multicourse hierarchy

This commit is contained in:
kimth
2012-08-15 14:45:12 -04:00
parent f1f80cb1f4
commit 02d970c31e
2 changed files with 16 additions and 1 deletions

View File

@@ -34,6 +34,17 @@ def wrap_xmodule(get_html, module, template):
return _get_html
def replace_course_urls(get_html, course_id, module):
"""
Updates the supplied module with a new get_html function that wraps
the old get_html function and substitutes urls of the form /course/...
with urls that are /courses/<course_id>/...
"""
@wraps(get_html)
def _get_html():
return replace_urls(get_html(), staticfiles_prefix='/courses/'+course_id, replace_prefix='/course/')
return _get_html
def replace_static_urls(get_html, prefix, module):
"""
Updates the supplied module with a new get_html function that wraps