Merge branch 'master' into will/use-mixed-modulestore-in-tests
Conflicts: common/lib/xmodule/xmodule/modulestore/django.py lms/djangoapps/courseware/tests/test_views.py lms/djangoapps/courseware/tests/tests.py
This commit is contained in:
@@ -119,7 +119,15 @@ def replace_static_urls(text, data_directory, course_id=None):
|
||||
elif course_id and modulestore().get_modulestore_type(course_id) != XML_MODULESTORE_TYPE:
|
||||
# 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):
|
||||
|
||||
exists_in_staticfiles_storage = False
|
||||
try:
|
||||
exists_in_staticfiles_storage = staticfiles_storage.exists(rest)
|
||||
except Exception as err:
|
||||
log.warning("staticfiles_storage couldn't find path {0}: {1}".format(
|
||||
rest, str(err)))
|
||||
|
||||
if exists_in_staticfiles_storage:
|
||||
url = staticfiles_storage.url(rest)
|
||||
else:
|
||||
# if not, then assume it's courseware specific content and then look in the
|
||||
@@ -142,6 +150,7 @@ def replace_static_urls(text, data_directory, course_id=None):
|
||||
|
||||
return "".join([quote, url, quote])
|
||||
|
||||
|
||||
return re.sub(
|
||||
_url_replace_regex('/static/(?!{data_dir})'.format(data_dir=data_directory)),
|
||||
replace_static_url,
|
||||
|
||||
Reference in New Issue
Block a user