From 271fa6956a2e4ee9364cee77ec6e481dd9c8e6fa Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Sat, 13 Oct 2012 18:53:32 -0400 Subject: [PATCH] save_item should also do proper 'is this element draft aware' logic so that incorrect versioning occurs on elements which do not support versioning at this point in time (aka courses, sections, and subsections). --- cms/djangoapps/contentstore/views.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index 9047a0b511..50fcda1d74 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -528,13 +528,15 @@ def save_item(request): if not has_access(request.user, item_location): raise PermissionDenied() + store = _modulestore(Location(item_location)); + if request.POST['data']: data = request.POST['data'] - modulestore().update_item(item_location, data) + store.update_item(item_location, data) if request.POST['children']: children = request.POST['children'] - modulestore().update_children(item_location, children) + store.update_children(item_location, children) # cdodge: also commit any metadata which might have been passed along in the # POST from the client, if it is there @@ -564,7 +566,7 @@ def save_item(request): existing_item.metadata.update(posted_metadata) # commit to datastore - modulestore().update_metadata(item_location, existing_item.metadata) + store.update_metadata(item_location, existing_item.metadata) return HttpResponse()