Commit fb4766e6 by Chris Dodge Committed by cahrens

be sure to first import 'extra' course content from base folder as well as a…

be sure to first import 'extra' course content from base folder as well as a special override folder for the course run
parent f1ed5611
...@@ -444,14 +444,20 @@ class XMLModuleStore(ModuleStoreBase): ...@@ -444,14 +444,20 @@ class XMLModuleStore(ModuleStoreBase):
log.debug('========> Done with course import from {0}'.format(course_dir)) log.debug('========> Done with course import from {0}'.format(course_dir))
return course_descriptor return course_descriptor
def load_extra_content(self, system, course_descriptor, category, base_dir, course_dir, url_name): def load_extra_content(self, system, course_descriptor, category, base_dir, course_dir, url_name):
if url_name:
path = base_dir / url_name
if not os.path.exists(path): self._load_extra_content(system, course_descriptor, category, base_dir, course_dir)
path = base_dir
# then look in a override folder based on the course run
if os.path.isdir(base_dir / url_name):
self._load_extra_content(system, course_descriptor, category, base_dir / url_name, course_dir)
def _load_extra_content(self, system, course_descriptor, category, path, course_dir):
for filepath in glob.glob(path/ '*'): for filepath in glob.glob(path/ '*'):
if not os.path.isdir(filepath):
with open(filepath) as f: with open(filepath) as f:
try: try:
html = f.read().decode('utf-8') html = f.read().decode('utf-8')
......
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