converge Split APIs with Mixed and Draft

This commit is contained in:
Nimisha Asthagiri
2014-07-10 13:58:29 -04:00
parent 1c5959988f
commit 7efd0cb49e
25 changed files with 501 additions and 314 deletions

View File

@@ -571,14 +571,14 @@ class SplitTestDescriptor(SplitTestFields, SequenceDescriptor, StudioEditableDes
A mutable modulestore is needed to call this method (will need to update after mixed
modulestore work, currently relies on mongo's create_and_save_xmodule method).
"""
assert hasattr(self.system, 'modulestore') and hasattr(self.system.modulestore, 'create_and_save_xmodule'), \
assert hasattr(self.system, 'modulestore') and hasattr(self.system.modulestore, 'create_item'), \
"editor_saved should only be called when a mutable modulestore is available"
modulestore = self.system.modulestore
dest_usage_key = self.location.replace(category="vertical", name=uuid4().hex)
metadata = {'display_name': group.name}
modulestore.create_and_save_xmodule(
dest_usage_key,
modulestore.create_item(
user_id,
dest_usage_key,
definition_data=None,
metadata=metadata,
runtime=self.system,