Merge pull request #12702 from edx/aj/PLAT-1032-fix-export

Fix course export on edge
This commit is contained in:
Awais Jibran
2016-06-13 18:46:56 +05:00
committed by GitHub
2 changed files with 27 additions and 2 deletions

View File

@@ -41,7 +41,6 @@ def _export_drafts(modulestore, course_key, export_fs, xml_centric_course_key):
# Check to see if the returned draft modules have changes w.r.t. the published module.
# Only modules with changes will be exported into the /drafts directory.
draft_modules = [module for module in draft_modules if modulestore.has_changes(module)]
if draft_modules:
draft_course_dir = export_fs.makeopendir(DRAFT_DIR)
@@ -85,9 +84,12 @@ def _export_drafts(modulestore, course_key, export_fs, xml_centric_course_key):
continue
logging.debug('parent_loc = %s', draft_node.parent_location)
draft_node.module.xml_attributes['parent_url'] = draft_node.parent_url
parent = modulestore.get_item(draft_node.parent_location)
# Don't try to export orphaned items
if draft_node.module.location not in parent.children:
continue
index = parent.children.index(draft_node.module.location)
draft_node.module.xml_attributes['index_in_children_list'] = str(index)