From b079b336db8a19419d654c8e920e00d300aebaf1 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Fri, 5 Oct 2012 11:22:31 -0400 Subject: [PATCH] Make updating children and data of a draft make the correct checks for whether the document is already a draft or not --- common/lib/xmodule/xmodule/modulestore/draft.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/modulestore/draft.py b/common/lib/xmodule/xmodule/modulestore/draft.py index dae6552978..671a710836 100644 --- a/common/lib/xmodule/xmodule/modulestore/draft.py +++ b/common/lib/xmodule/xmodule/modulestore/draft.py @@ -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):