Commit cb70a0f9 by Christina Roberts

Merge pull request #1620 from MITx/fix/cdodge/static-url-allow-references-to-common

need to support link references to static content that is in the code ba...
parents 85d5264f 891bddcd
......@@ -84,12 +84,15 @@ def replace_static_urls(text, data_directory, course_namespace=None):
if rest.endswith('?raw'):
return original
# course_namespace is not None, then use studio style urls
if course_namespace is not None and not isinstance(modulestore(), XMLModuleStore):
url = StaticContent.convert_legacy_static_url(rest, course_namespace)
# In debug mode, if we can find the url as is,
elif settings.DEBUG and finders.find(rest, True):
if settings.DEBUG and finders.find(rest, True):
return original
# course_namespace is not None, then use studio style urls
elif course_namespace is not None and not isinstance(modulestore(), XMLModuleStore):
if staticfiles_storage.exists(rest):
url = staticfiles_storage.url(rest)
else:
url = StaticContent.convert_legacy_static_url(rest, course_namespace)
# Otherwise, look the file up in staticfiles_storage, and append the data directory if needed
else:
course_path = "/".join((data_directory, rest))
......
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