Commit 2a35132b by Chris Dodge

When importing a course, we need to set the 'display_name' on the static tab…

When importing a course, we need to set the 'display_name' on the static tab module from the course module's policy. This isn't ideal, but the static tab definition on disk does not encapsulate the tab's display name on the LMS - we have to take it from the course
parent 9ae85583
...@@ -455,6 +455,13 @@ class XMLModuleStore(ModuleStoreBase): ...@@ -455,6 +455,13 @@ class XMLModuleStore(ModuleStoreBase):
slug = os.path.splitext(os.path.basename(filepath))[0] slug = os.path.splitext(os.path.basename(filepath))[0]
loc = Location('i4x', course_descriptor.location.org, course_descriptor.location.course, category, slug) loc = Location('i4x', course_descriptor.location.org, course_descriptor.location.course, category, slug)
module = HtmlDescriptor(system, definition={'data' : html}, **{'location' : loc}) module = HtmlDescriptor(system, definition={'data' : html}, **{'location' : loc})
# VS[compat]:
# Hack because we need to pull in the 'display_name' for static tabs (because we need to edit them)
# from the course policy
if category == "static_tab":
for tab in course_descriptor.tabs or []:
if tab.get('url_slug') == slug:
module.metadata['display_name'] = tab['name']
module.metadata['data_dir'] = course_dir module.metadata['data_dir'] = course_dir
self.modules[course_descriptor.id][module.location] = module self.modules[course_descriptor.id][module.location] = module
except Exception, e: except Exception, e:
......
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