Commit b079b336 by Calen Pennington

Make updating children and data of a draft make the correct checks for whether…

Make updating children and data of a draft make the correct checks for whether the document is already a draft or not
parent 310f26a6
......@@ -112,7 +112,7 @@ class DraftModuleStore(ModuleStoreBase):
"""
draft_loc = as_draft(location)
draft_item = self.get_item(location)
if draft_item.location.revision != DRAFT:
if not draft_item.metadata['is_draft']:
self.clone_item(location, draft_loc)
return super(DraftModuleStore, self).update_item(draft_loc, data)
......@@ -143,12 +143,12 @@ class DraftModuleStore(ModuleStoreBase):
draft_loc = as_draft(location)
draft_item = self.get_item(location)
if not draft_item.metadata['is_draft']:
self.clone_item(location, draft_loc)
if 'is_draft' in metadata:
del metadata['is_draft']
if draft_item.location.revision != DRAFT:
self.clone_item(location, draft_loc)
return super(DraftModuleStore, self).update_metadata(draft_loc, metadata)
def delete_item(self, location):
......
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