Commit 9e6249dd by cahrens

Enable split for new courses.

parent 61f86369
...@@ -664,10 +664,7 @@ def _create_new_course(request, org, number, run, fields): ...@@ -664,10 +664,7 @@ def _create_new_course(request, org, number, run, fields):
Returns the URL for the course overview page. Returns the URL for the course overview page.
Raises DuplicateCourseError if the course already exists Raises DuplicateCourseError if the course already exists
""" """
store_for_new_course = ( store_for_new_course = modulestore().default_modulestore.get_modulestore_type()
settings.FEATURES.get('DEFAULT_STORE_FOR_NEW_COURSE') or
modulestore().default_modulestore.get_modulestore_type()
)
new_course = create_new_course_in_store(store_for_new_course, request.user, org, number, run, fields) new_course = create_new_course_in_store(store_for_new_course, request.user, org, number, run, fields)
return JsonResponse({ return JsonResponse({
'url': reverse_course_url('course_handler', new_course.id), 'url': reverse_course_url('course_handler', new_course.id),
......
...@@ -35,7 +35,7 @@ import sys ...@@ -35,7 +35,7 @@ import sys
import lms.envs.common import lms.envs.common
# Although this module itself may not use these imported variables, other dependent modules may. # Although this module itself may not use these imported variables, other dependent modules may.
from lms.envs.common import ( 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 update_module_store_settings, ASSET_IGNORE_REGEX, COPYRIGHT_YEAR
) )
from path import path from path import path
...@@ -112,9 +112,6 @@ FEATURES = { ...@@ -112,9 +112,6 @@ FEATURES = {
# Turn off Advanced Security by default # Turn off Advanced Security by default
'ADVANCED_SECURITY': False, 'ADVANCED_SECURITY': False,
# Modulestore to use for new courses
'DEFAULT_STORE_FOR_NEW_COURSE': None,
# Turn off Video Upload Pipeline through Studio, by default # Turn off Video Upload Pipeline through Studio, by default
'ENABLE_VIDEO_UPLOAD_PIPELINE': False, 'ENABLE_VIDEO_UPLOAD_PIPELINE': False,
...@@ -130,9 +127,7 @@ FEATURES = { ...@@ -130,9 +127,7 @@ FEATURES = {
'ENABLE_EDXNOTES': False, 'ENABLE_EDXNOTES': False,
# Enable support for content libraries. Note that content libraries are # Enable support for content libraries. Note that content libraries are
# only supported in courses using split mongo. Change the setting # only supported in courses using split mongo.
# DEFAULT_STORE_FOR_NEW_COURSE to be 'split' to have future courses
# and libraries created with split.
'ENABLE_CONTENT_LIBRARIES': False, 'ENABLE_CONTENT_LIBRARIES': False,
# Milestones application flag # Milestones application flag
...@@ -314,6 +309,37 @@ XBLOCK_SELECT_FUNCTION = prefer_xmodules ...@@ -314,6 +309,37 @@ XBLOCK_SELECT_FUNCTION = prefer_xmodules
############################ Modulestore Configuration ################################ ############################ Modulestore Configuration ################################
MODULESTORE_BRANCH = 'draft-preferred' 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 ################################ ############################ DJANGO_BUILTINS ################################
# Change DEBUG/TEMPLATE_DEBUG in your environment settings files, not here # Change DEBUG/TEMPLATE_DEBUG in your environment settings files, not here
DEBUG = False DEBUG = False
......
...@@ -627,8 +627,8 @@ MODULESTORE = { ...@@ -627,8 +627,8 @@ MODULESTORE = {
'mappings': {}, 'mappings': {},
'stores': [ 'stores': [
{ {
'NAME': 'draft', 'NAME': 'split',
'ENGINE': 'xmodule.modulestore.mongo.DraftMongoModuleStore', 'ENGINE': 'xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore',
'DOC_STORE_CONFIG': DOC_STORE_CONFIG, 'DOC_STORE_CONFIG': DOC_STORE_CONFIG,
'OPTIONS': { 'OPTIONS': {
'default_class': 'xmodule.hidden_module.HiddenDescriptor', 'default_class': 'xmodule.hidden_module.HiddenDescriptor',
...@@ -637,23 +637,23 @@ MODULESTORE = { ...@@ -637,23 +637,23 @@ MODULESTORE = {
} }
}, },
{ {
'NAME': 'xml', 'NAME': 'draft',
'ENGINE': 'xmodule.modulestore.xml.XMLModuleStore', 'ENGINE': 'xmodule.modulestore.mongo.DraftMongoModuleStore',
'DOC_STORE_CONFIG': DOC_STORE_CONFIG,
'OPTIONS': { 'OPTIONS': {
'data_dir': DATA_DIR,
'default_class': 'xmodule.hidden_module.HiddenDescriptor', 'default_class': 'xmodule.hidden_module.HiddenDescriptor',
'fs_root': DATA_DIR,
'render_template': 'edxmako.shortcuts.render_to_string',
} }
}, },
{ {
'NAME': 'split', 'NAME': 'xml',
'ENGINE': 'xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore', 'ENGINE': 'xmodule.modulestore.xml.XMLModuleStore',
'DOC_STORE_CONFIG': DOC_STORE_CONFIG,
'OPTIONS': { 'OPTIONS': {
'data_dir': DATA_DIR,
'default_class': 'xmodule.hidden_module.HiddenDescriptor', 'default_class': 'xmodule.hidden_module.HiddenDescriptor',
'fs_root': DATA_DIR,
'render_template': 'edxmako.shortcuts.render_to_string',
} }
}, }
] ]
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment