From 7a75b94ff7bcc6aa1ee6c1505b8300703c2d5512 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Wed, 6 Aug 2014 11:27:14 -0400 Subject: [PATCH] Support xml blocks w/ multiple parents --- common/lib/xmodule/xmodule/modulestore/xml_importer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/modulestore/xml_importer.py b/common/lib/xmodule/xmodule/modulestore/xml_importer.py index ad56bfe721..36800d0799 100644 --- a/common/lib/xmodule/xmodule/modulestore/xml_importer.py +++ b/common/lib/xmodule/xmodule/modulestore/xml_importer.py @@ -233,7 +233,12 @@ def import_from_xml( """ if subtree.has_children: for child in subtree.get_children(): - all_locs.remove(child.location) + try: + all_locs.remove(child.location) + except KeyError: + # ContentStoreTest.test_image_import has non-tree children + # so, make this more robust + pass if verbose: log.debug('importing module location {loc}'.format(loc=child.location))