Commit 83962d64 by Calen Pennington Committed by John Eskew

Allow CourseAboutFactory to be used without django by explicitly passing in a modulestore

parent 225f4426
...@@ -15,7 +15,6 @@ from opaque_keys.edx.keys import UsageKey ...@@ -15,7 +15,6 @@ from opaque_keys.edx.keys import UsageKey
from xblock.core import XBlock from xblock.core import XBlock
from xmodule.tabs import StaticTab from xmodule.tabs import StaticTab
from xmodule.modulestore import prefer_xmodules, ModuleStoreEnum from xmodule.modulestore import prefer_xmodules, ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.x_module import DEPRECATION_VSCOMPAT_EVENT from xmodule.x_module import DEPRECATION_VSCOMPAT_EVENT
...@@ -422,7 +421,7 @@ class CourseAboutFactory(XModuleFactory): ...@@ -422,7 +421,7 @@ class CourseAboutFactory(XModuleFactory):
""" """
user_id = kwargs.pop('user_id', None) user_id = kwargs.pop('user_id', None)
course_id, course_runtime = kwargs.pop("course_id"), kwargs.pop("course_runtime") course_id, course_runtime = kwargs.pop("course_id"), kwargs.pop("course_runtime")
store = modulestore() store = kwargs.pop('modulestore')
for about_key in ABOUT_ATTRIBUTES: for about_key in ABOUT_ATTRIBUTES:
about_item = store.create_xblock(course_runtime, course_id, 'about', about_key) about_item = store.create_xblock(course_runtime, course_id, 'about', about_key)
about_item.data = ABOUT_ATTRIBUTES[about_key] about_item.data = ABOUT_ATTRIBUTES[about_key]
......
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