Commit c23c5cc3 by Chris Dodge

add comments

parent cb70a0f9
...@@ -87,11 +87,15 @@ def replace_static_urls(text, data_directory, course_namespace=None): ...@@ -87,11 +87,15 @@ def replace_static_urls(text, data_directory, course_namespace=None):
# In debug mode, if we can find the url as is, # In debug mode, if we can find the url as is,
if settings.DEBUG and finders.find(rest, True): if settings.DEBUG and finders.find(rest, True):
return original return original
# course_namespace is not None, then use studio style urls # if we're running with a MongoBacked store course_namespace is not None, then use studio style urls
elif course_namespace is not None and not isinstance(modulestore(), XMLModuleStore): elif course_namespace is not None and not isinstance(modulestore(), XMLModuleStore):
# first look in the static file pipeline and see if we are trying to reference
# a piece of static content which is in the mitx repo (e.g. JS associated with an xmodule)
if staticfiles_storage.exists(rest): if staticfiles_storage.exists(rest):
url = staticfiles_storage.url(rest) url = staticfiles_storage.url(rest)
else: else:
# if not, then assume it's courseware specific content and then look in the
# Mongo-backed database
url = StaticContent.convert_legacy_static_url(rest, course_namespace) url = StaticContent.convert_legacy_static_url(rest, course_namespace)
# Otherwise, look the file up in staticfiles_storage, and append the data directory if needed # Otherwise, look the file up in staticfiles_storage, and append the data directory if needed
else: else:
......
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