diff --git a/cms/djangoapps/contentstore/views/course.py b/cms/djangoapps/contentstore/views/course.py index 1b62db5842..ef2c648f59 100644 --- a/cms/djangoapps/contentstore/views/course.py +++ b/cms/djangoapps/contentstore/views/course.py @@ -664,10 +664,7 @@ def _create_new_course(request, org, number, run, fields): Returns the URL for the course overview page. Raises DuplicateCourseError if the course already exists """ - store_for_new_course = ( - settings.FEATURES.get('DEFAULT_STORE_FOR_NEW_COURSE') or - modulestore().default_modulestore.get_modulestore_type() - ) + store_for_new_course = modulestore().default_modulestore.get_modulestore_type() new_course = create_new_course_in_store(store_for_new_course, request.user, org, number, run, fields) return JsonResponse({ 'url': reverse_course_url('course_handler', new_course.id), diff --git a/cms/envs/common.py b/cms/envs/common.py index 9404427b0f..fbc8eb311a 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -35,7 +35,7 @@ import sys import lms.envs.common # Although this module itself may not use these imported variables, other dependent modules may. from lms.envs.common import ( - USE_TZ, TECH_SUPPORT_EMAIL, PLATFORM_NAME, BUGS_EMAIL, DOC_STORE_CONFIG, ALL_LANGUAGES, WIKI_ENABLED, MODULESTORE, + USE_TZ, TECH_SUPPORT_EMAIL, PLATFORM_NAME, BUGS_EMAIL, DOC_STORE_CONFIG, DATA_DIR, ALL_LANGUAGES, WIKI_ENABLED, update_module_store_settings, ASSET_IGNORE_REGEX, COPYRIGHT_YEAR ) from path import path @@ -112,9 +112,6 @@ FEATURES = { # Turn off Advanced Security by default 'ADVANCED_SECURITY': False, - # Modulestore to use for new courses - 'DEFAULT_STORE_FOR_NEW_COURSE': None, - # Turn off Video Upload Pipeline through Studio, by default 'ENABLE_VIDEO_UPLOAD_PIPELINE': False, @@ -130,9 +127,7 @@ FEATURES = { 'ENABLE_EDXNOTES': False, # Enable support for content libraries. Note that content libraries are - # only supported in courses using split mongo. Change the setting - # DEFAULT_STORE_FOR_NEW_COURSE to be 'split' to have future courses - # and libraries created with split. + # only supported in courses using split mongo. 'ENABLE_CONTENT_LIBRARIES': False, # Milestones application flag @@ -314,6 +309,37 @@ XBLOCK_SELECT_FUNCTION = prefer_xmodules ############################ Modulestore Configuration ################################ MODULESTORE_BRANCH = 'draft-preferred' +MODULESTORE = { + 'default': { + 'ENGINE': 'xmodule.modulestore.mixed.MixedModuleStore', + 'OPTIONS': { + 'mappings': {}, + 'stores': [ + { + 'NAME': 'split', + 'ENGINE': 'xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore', + 'DOC_STORE_CONFIG': DOC_STORE_CONFIG, + 'OPTIONS': { + 'default_class': 'xmodule.hidden_module.HiddenDescriptor', + 'fs_root': DATA_DIR, + 'render_template': 'edxmako.shortcuts.render_to_string', + } + }, + { + 'NAME': 'draft', + 'ENGINE': 'xmodule.modulestore.mongo.DraftMongoModuleStore', + 'DOC_STORE_CONFIG': DOC_STORE_CONFIG, + 'OPTIONS': { + 'default_class': 'xmodule.hidden_module.HiddenDescriptor', + 'fs_root': DATA_DIR, + 'render_template': 'edxmako.shortcuts.render_to_string', + } + } + ] + } + } +} + ############################ DJANGO_BUILTINS ################################ # Change DEBUG/TEMPLATE_DEBUG in your environment settings files, not here DEBUG = False diff --git a/lms/envs/common.py b/lms/envs/common.py index 4146828573..3be88b5932 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -626,6 +626,16 @@ MODULESTORE = { 'OPTIONS': { 'mappings': {}, 'stores': [ + { + 'NAME': 'split', + 'ENGINE': 'xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore', + 'DOC_STORE_CONFIG': DOC_STORE_CONFIG, + 'OPTIONS': { + 'default_class': 'xmodule.hidden_module.HiddenDescriptor', + 'fs_root': DATA_DIR, + 'render_template': 'edxmako.shortcuts.render_to_string', + } + }, { 'NAME': 'draft', 'ENGINE': 'xmodule.modulestore.mongo.DraftMongoModuleStore', @@ -643,17 +653,7 @@ MODULESTORE = { 'data_dir': DATA_DIR, 'default_class': 'xmodule.hidden_module.HiddenDescriptor', } - }, - { - 'NAME': 'split', - 'ENGINE': 'xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore', - 'DOC_STORE_CONFIG': DOC_STORE_CONFIG, - 'OPTIONS': { - 'default_class': 'xmodule.hidden_module.HiddenDescriptor', - 'fs_root': DATA_DIR, - 'render_template': 'edxmako.shortcuts.render_to_string', - } - }, + } ] } }