From 8dca8053f6d7c7166d502ecd81bdce875a82ee9a Mon Sep 17 00:00:00 2001 From: Nimisha Asthagiri Date: Fri, 27 Jun 2014 21:47:53 -0400 Subject: [PATCH] Fix branch settings. --- cms/envs/common.py | 2 +- .../xmodule/xmodule/modulestore/split_mongo/split.py | 10 +++------- lms/envs/common.py | 2 +- lms/envs/test.py | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/cms/envs/common.py b/cms/envs/common.py index a51ffe9ae5..7cfa0c31fa 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -247,7 +247,7 @@ XBLOCK_MIXINS = (LmsBlockMixin, InheritanceMixin, XModuleMixin) XBLOCK_SELECT_FUNCTION = prefer_xmodules ############################ Modulestore Configuration ################################ -MODULESTORE_BRANCH = 'draft' +MODULESTORE_BRANCH = 'draft-preferred' ############################ DJANGO_BUILTINS ################################ # Change DEBUG/TEMPLATE_DEBUG in your environment settings files, not here diff --git a/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py b/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py index 1c212a2985..ccc1123f6f 100644 --- a/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py +++ b/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py @@ -492,7 +492,7 @@ class SplitMongoModuleStore(ModuleStoreWriteBase): def get_orphans(self, course_key): """ - Return a dict of all of the orphans in the course. + Return an array of all of the orphans in the course. """ detached_categories = [name for name, __ in XBlock.load_tagged_classes("detached")] course = self._lookup_course(course_key) @@ -1298,7 +1298,7 @@ class SplitMongoModuleStore(ModuleStoreWriteBase): self._update_head(index_entry, destination_course.branch, destination_structure['_id']) def unpublish(self, location, user_id): - published_location = location.replace(branch=ModuleStoreEnum.RevisionOption.published_only) + published_location = location.replace(branch=ModuleStoreEnum.BranchName.published) self.delete_item(published_location, user_id) def update_course_index(self, updated_index_entry): @@ -1456,11 +1456,7 @@ class SplitMongoModuleStore(ModuleStoreWriteBase): def get_modulestore_type(self, course_key=None): """ - Returns an enumeration-like type reflecting the type of this modulestore - The return can be one of: - "xml" (for XML based courses), - "mongo" for old-style MongoDB backed courses, - "split" for new-style split MongoDB backed courses. + Returns an enumeration-like type reflecting the type of this modulestore, per ModuleStoreEnum.Type. Args: course_key: just for signature compatibility diff --git a/lms/envs/common.py b/lms/envs/common.py index 8953e4728f..5b889ef896 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -475,7 +475,7 @@ XBLOCK_SELECT_FUNCTION = prefer_xmodules ############# ModuleStore Configuration ########## -MODULESTORE_BRANCH = 'published' +MODULESTORE_BRANCH = 'published-only' CONTENTSTORE = None DOC_STORE_CONFIG = { 'host': 'localhost', diff --git a/lms/envs/test.py b/lms/envs/test.py index 0eec134522..6808be7b9a 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -109,7 +109,7 @@ STATICFILES_DIRS += [ if os.path.isdir(COMMON_TEST_DATA_ROOT / course_dir) ] -MODULESTORE_BRANCH = 'draft' +MODULESTORE_BRANCH = 'draft-preferred' update_module_store_settings( MODULESTORE, module_store_options={