diff --git a/common/lib/xmodule/xmodule/modulestore/store_utilities.py b/common/lib/xmodule/xmodule/modulestore/store_utilities.py index e90613d0da..6beffcb71d 100644 --- a/common/lib/xmodule/xmodule/modulestore/store_utilities.py +++ b/common/lib/xmodule/xmodule/modulestore/store_utilities.py @@ -13,10 +13,19 @@ def clone_course(modulestore, contentstore, source_location, dest_location, dele if not modulestore.has_item(dest_location): raise Exception("An empty course at {0} must have already been created. Aborting...".format(dest_location)) - # verify that the dest_location really is an empty course, which means only one + # verify that the dest_location really is an empty course, which means only one with an optional 'overview' dest_modules = modulestore.get_items([dest_location.tag, dest_location.org, dest_location.course, None, None, None]) - if len(dest_modules) != 1: + basically_empty = True + for module in dest_modules: + if module.location.category == 'course' or (module.location.category == 'about' + and module.location.name == 'overview'): + continue + + basically_empty = False + break + + if not basically_empty: raise Exception("Course at destination {0} is not an empty course. You can only clone into an empty course. Aborting...".format(dest_location)) # check to see if the source course is actually there