Remove ModuleStoreEnum.Type.xml

This commit is contained in:
John Eskew
2015-12-23 14:00:36 -05:00
parent 91c94977d5
commit 8a9845c26e
15 changed files with 13 additions and 60 deletions

View File

@@ -164,8 +164,7 @@ def replace_static_urls(text, data_directory=None, course_id=None, static_asset_
return original
# if we're running with a MongoBacked store course_namespace is not None, then use studio style urls
elif (not static_asset_path) \
and course_id \
and modulestore().get_modulestore_type(course_id) != ModuleStoreEnum.Type.xml:
and course_id:
# first look in the static file pipeline and see if we are trying to reference
# a piece of static content which is in the edx-platform repo (e.g. JS associated with an xmodule)

View File

@@ -649,7 +649,6 @@ def dashboard(request):
show_email_settings_for = frozenset(
enrollment.course_id for enrollment in course_enrollments if (
settings.FEATURES['ENABLE_INSTRUCTOR_EMAIL'] and
modulestore().get_modulestore_type(enrollment.course_id) != ModuleStoreEnum.Type.xml and
CourseAuthorization.instructor_email_enabled(enrollment.course_id)
)
)

View File

@@ -55,7 +55,6 @@ class ModuleStoreEnum(object):
"""
split = 'split'
mongo = 'mongo'
xml = 'xml'
class RevisionOption(object):
"""

View File

@@ -1991,11 +1991,8 @@ class TestMixedModuleStore(CommonMixedModuleStoreSetup):
self.assertEquals(store.get_modulestore_type(), store_type)
# verify store used for creating a course
try:
course = self.store.create_course("org", "course{}".format(uuid4().hex[:5]), "run", self.user_id)
self.assertEquals(course.system.modulestore.get_modulestore_type(), store_type)
except NotImplementedError:
self.assertEquals(store_type, ModuleStoreEnum.Type.xml)
course = self.store.create_course("org", "course{}".format(uuid4().hex[:5]), "run", self.user_id)
self.assertEquals(course.system.modulestore.get_modulestore_type(), store_type)
@ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split)
def test_default_store(self, default_ms):

View File

@@ -31,10 +31,6 @@ class TestXMLModuleStore(unittest.TestCase):
"""
Test around the XML modulestore
"""
def test_xml_modulestore_type(self):
store = XMLModuleStore(DATA_DIR, source_dirs=[])
self.assertEqual(store.get_modulestore_type(), ModuleStoreEnum.Type.xml)
@patch('xmodule.tabs.CourseTabList.initialize_default', Mock())
def test_unicode_chars_in_xml_content(self):
# edX/full/6.002_Spring_2012 has non-ASCII chars, and during

View File

@@ -875,7 +875,7 @@ class XMLModuleStore(ModuleStoreReadBase):
Args:
course_key: just for signature compatibility
"""
return ModuleStoreEnum.Type.xml
return None #ModuleStoreEnum.Type.xml
def get_courses_for_wiki(self, wiki_slug, **kwargs):
"""
@@ -893,7 +893,7 @@ class XMLModuleStore(ModuleStoreReadBase):
Returns the course count
"""
return {ModuleStoreEnum.Type.xml: True}
return {'xml': True}
@contextmanager
def branch_setting(self, branch_setting, course_id=None): # pylint: disable=unused-argument

View File

@@ -279,9 +279,7 @@ class CourseExportManager(ExportManager):
policy = {'course/' + courselike.location.name: own_metadata(courselike)}
course_policy.write(dumps(policy, cls=EdxJSONEncoder, sort_keys=True, indent=4))
# xml backed courses don't support drafts!
if courselike.runtime.modulestore.get_modulestore_type() != ModuleStoreEnum.Type.xml:
_export_drafts(self.modulestore, self.courselike_key, export_fs, xml_centric_courselike_key)
_export_drafts(self.modulestore, self.courselike_key, export_fs, xml_centric_courselike_key)
class LibraryExportManager(ExportManager):