Commit 43df25d4 by Don Mitchell

Point to prefer_xmodules new locn

parent f371c4f5
...@@ -122,10 +122,14 @@ class MixedModuleStore(ModuleStoreWriteBase): ...@@ -122,10 +122,14 @@ class MixedModuleStore(ModuleStoreWriteBase):
Returns a list containing the top level XModuleDescriptors of the courses Returns a list containing the top level XModuleDescriptors of the courses
in this modulestore. in this modulestore.
''' '''
courses = {} courses = {} # a dictionary of stringified course locations to course objects
# order the modulestores and ensure no dupes: an awkward bit of hardcoding to ensure precedence # order the modulestores and ensure no dupes: an awkward bit of hardcoding to ensure precedence
# xml is in here because mappings trump discovery # xml is in here because mappings trump discovery
stores = [self.modulestores['default'], self.modulestores['xml']] if self.modulestores.has_key('xml'):
stores = [self.modulestores['default'], self.modulestores['xml']]
else:
stores = [self.modulestores['default']]
for key, store in self.modulestores.iteritems(): for key, store in self.modulestores.iteritems():
# awkward hardcoding of knowledge that 'draft' is a dupe of 'direct' # awkward hardcoding of knowledge that 'draft' is a dupe of 'direct'
if key != 'draft' and store not in stores: if key != 'draft' and store not in stores:
...@@ -194,7 +198,7 @@ class MixedModuleStore(ModuleStoreWriteBase): ...@@ -194,7 +198,7 @@ class MixedModuleStore(ModuleStoreWriteBase):
usually orphaned. NOTE: may include xblocks which still have references via xblocks which don't usually orphaned. NOTE: may include xblocks which still have references via xblocks which don't
use children to point to their dependents. use children to point to their dependents.
""" """
course_id = getattr(course_location, 'course_id', getattr(course_location, 'package_id', None)) course_id = self._get_course_id_from_course_location(course_location)
store = self._get_modulestore_for_courseid(course_id) store = self._get_modulestore_for_courseid(course_id)
return store.get_orphans(course_location, branch) return store.get_orphans(course_location, branch)
......
...@@ -4,7 +4,7 @@ Settings for bok choy tests ...@@ -4,7 +4,7 @@ Settings for bok choy tests
import os import os
from path import path from path import path
from xmodule.x_module import prefer_xmodules from xmodule.modulestore import prefer_xmodules
CONFIG_ROOT = path(__file__).abspath().dirname() #pylint: disable=E1120 CONFIG_ROOT = path(__file__).abspath().dirname() #pylint: disable=E1120
......
...@@ -438,7 +438,7 @@ XBLOCK_SELECT_FUNCTION = only_xmodules ...@@ -438,7 +438,7 @@ XBLOCK_SELECT_FUNCTION = only_xmodules
# Use the following lines to allow any xblock in the LMS, # Use the following lines to allow any xblock in the LMS,
# either by uncommenting them here, or adding them to your private.py # either by uncommenting them here, or adding them to your private.py
# from xmodule.x_module import prefer_xmodules # from xmodule.modulestore import prefer_xmodules
# XBLOCK_SELECT_FUNCTION = prefer_xmodules # XBLOCK_SELECT_FUNCTION = prefer_xmodules
#################### Python sandbox ############################################ #################### Python sandbox ############################################
......
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