From 33f9eae3e880b5b105045b91eb456f683c0938f7 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Mon, 24 Sep 2012 11:15:37 -0400 Subject: [PATCH] Set data_dir based on parent data_dir when cloning new content in the CMS --- cms/djangoapps/contentstore/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index 7819a45fec..da6611f248 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -382,6 +382,10 @@ def clone_item(request): new_item = modulestore().clone_item(template, dest_location) new_item.metadata['display_name'] = display_name + + # TODO: This needs to be deleted when we have proper storage for static content + new_item.metadata['data_dir'] = parent.metadata['data_dir'] + modulestore().update_metadata(new_item.location.url(), new_item.own_metadata) modulestore().update_children(parent_location, parent.definition.get('children', []) + [new_item.location.url()])