Commit 6e949195 by Calen Pennington

Delay import of xmodule packages until after sys.path fixup

parent 5f2de765
...@@ -16,8 +16,6 @@ os.environ['SERVICE_VARIANT'] = 'bok_choy' ...@@ -16,8 +16,6 @@ os.environ['SERVICE_VARIANT'] = 'bok_choy'
os.environ['CONFIG_ROOT'] = path(__file__).abspath().dirname() #pylint: disable=E1120 os.environ['CONFIG_ROOT'] = path(__file__).abspath().dirname() #pylint: disable=E1120
from .aws import * # pylint: disable=W0401, W0614 from .aws import * # pylint: disable=W0401, W0614
from xmodule.modulestore import prefer_xmodules
######################### Testing overrides #################################### ######################### Testing overrides ####################################
...@@ -49,8 +47,5 @@ for log_name, log_level in LOG_OVERRIDES: ...@@ -49,8 +47,5 @@ for log_name, log_level in LOG_OVERRIDES:
# Use the auto_auth workflow for creating users and logging them in # Use the auto_auth workflow for creating users and logging them in
FEATURES['AUTOMATIC_AUTH_FOR_TESTING'] = True FEATURES['AUTOMATIC_AUTH_FOR_TESTING'] = True
# Enable XBlocks
XBLOCK_SELECT_FUNCTION = prefer_xmodules
# Unfortunately, we need to use debug mode to serve staticfiles # Unfortunately, we need to use debug mode to serve staticfiles
DEBUG = True DEBUG = True
...@@ -34,9 +34,6 @@ from path import path ...@@ -34,9 +34,6 @@ from path import path
from lms.lib.xblock.mixin import LmsBlockMixin from lms.lib.xblock.mixin import LmsBlockMixin
from cms.lib.xblock.mixin import CmsBlockMixin from cms.lib.xblock.mixin import CmsBlockMixin
from xmodule.modulestore.inheritance import InheritanceMixin
from xmodule.modulestore import prefer_xmodules
from xmodule.x_module import XModuleMixin
from dealer.git import git from dealer.git import git
############################ FEATURE CONFIGURATION ############################# ############################ FEATURE CONFIGURATION #############################
...@@ -220,6 +217,11 @@ X_FRAME_OPTIONS = 'ALLOW' ...@@ -220,6 +217,11 @@ X_FRAME_OPTIONS = 'ALLOW'
############# XBlock Configuration ########## ############# XBlock Configuration ##########
# Import after sys.path fixup
from xmodule.modulestore.inheritance import InheritanceMixin
from xmodule.modulestore import prefer_xmodules
from xmodule.x_module import XModuleMixin
# This should be moved into an XBlock Runtime/Application object # This should be moved into an XBlock Runtime/Application object
# once the responsibility of XBlock creation is moved out of modulestore - cpennington # once the responsibility of XBlock creation is moved out of modulestore - cpennington
XBLOCK_MIXINS = (LmsBlockMixin, CmsBlockMixin, InheritanceMixin, XModuleMixin) XBLOCK_MIXINS = (LmsBlockMixin, CmsBlockMixin, InheritanceMixin, XModuleMixin)
......
...@@ -16,7 +16,6 @@ from .common import * ...@@ -16,7 +16,6 @@ from .common import *
import os import os
from path import path from path import path
from warnings import filterwarnings from warnings import filterwarnings
from xmodule.modulestore import prefer_xmodules
# Nose Test Runner # Nose Test Runner
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
...@@ -158,10 +157,6 @@ INSTALLED_APPS += ('external_auth', ) ...@@ -158,10 +157,6 @@ INSTALLED_APPS += ('external_auth', )
filterwarnings('ignore', message='No request passed to the backend, unable to rate-limit') filterwarnings('ignore', message='No request passed to the backend, unable to rate-limit')
################################# XBLOCK ######################################
XBLOCK_SELECT_FUNCTION = prefer_xmodules
################################# CELERY ###################################### ################################# CELERY ######################################
CELERY_ALWAYS_EAGER = True CELERY_ALWAYS_EAGER = True
......
...@@ -4,8 +4,6 @@ Settings for bok choy tests ...@@ -4,8 +4,6 @@ Settings for bok choy tests
import os import os
from path import path from path import path
from xmodule.modulestore import prefer_xmodules
CONFIG_ROOT = path(__file__).abspath().dirname() #pylint: disable=E1120 CONFIG_ROOT = path(__file__).abspath().dirname() #pylint: disable=E1120
TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root" TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root"
...@@ -60,8 +58,5 @@ LOG_OVERRIDES = [ ...@@ -60,8 +58,5 @@ LOG_OVERRIDES = [
for log_name, log_level in LOG_OVERRIDES: for log_name, log_level in LOG_OVERRIDES:
logging.getLogger(log_name).setLevel(log_level) logging.getLogger(log_name).setLevel(log_level)
# Enable XBlocks
XBLOCK_SELECT_FUNCTION = prefer_xmodules
# Unfortunately, we need to use debug mode to serve staticfiles # Unfortunately, we need to use debug mode to serve staticfiles
DEBUG = True DEBUG = True
...@@ -34,9 +34,6 @@ from path import path ...@@ -34,9 +34,6 @@ from path import path
from .discussionsettings import * from .discussionsettings import *
from lms.lib.xblock.mixin import LmsBlockMixin from lms.lib.xblock.mixin import LmsBlockMixin
from xmodule.modulestore.inheritance import InheritanceMixin
from xmodule.modulestore import prefer_xmodules
from xmodule.x_module import XModuleMixin
################################### FEATURES ################################### ################################### FEATURES ###################################
# The display name of the platform to be used in templates/emails/etc. # The display name of the platform to be used in templates/emails/etc.
...@@ -433,6 +430,11 @@ DOC_STORE_CONFIG = { ...@@ -433,6 +430,11 @@ DOC_STORE_CONFIG = {
############# XBlock Configuration ########## ############# XBlock Configuration ##########
# Import after sys.path fixup
from xmodule.modulestore.inheritance import InheritanceMixin
from xmodule.modulestore import prefer_xmodules
from xmodule.x_module import XModuleMixin
# This should be moved into an XBlock Runtime/Application object # This should be moved into an XBlock Runtime/Application object
# once the responsibility of XBlock creation is moved out of modulestore - cpennington # once the responsibility of XBlock creation is moved out of modulestore - cpennington
XBLOCK_MIXINS = (LmsBlockMixin, InheritanceMixin, XModuleMixin) XBLOCK_MIXINS = (LmsBlockMixin, InheritanceMixin, XModuleMixin)
......
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