diff --git a/src/ol_openedx_chat/ol_openedx_chat/block.py b/src/ol_openedx_chat/ol_openedx_chat/block.py index 4ccc04fd7..16bc24e8d 100644 --- a/src/ol_openedx_chat/ol_openedx_chat/block.py +++ b/src/ol_openedx_chat/ol_openedx_chat/block.py @@ -11,7 +11,13 @@ from webob.response import Response from xblock.core import XBlock, XBlockAside from xblock.fields import Boolean, Scope -from xmodule.modulestore.xml import ImportSystem + +try: + from xmodule.modulestore.xml import ( + XMLImportingModuleStoreRuntime as XMLImportingModuleStoreRuntime, # noqa: PLC0414 + ) +except ImportError: + from xmodule.modulestore.xml import ImportSystem as XMLImportingModuleStoreRuntime from xmodule.video_block.transcripts_utils import ( Transcript, get_available_transcript_languages, @@ -211,7 +217,7 @@ def should_apply_to_block(cls, block): # In that case, we cannot check for the course settings and waffle flag. # We only check for the block type. For normal CMS and LMS flows, it will # check for the course settings and waffle flag. - if isinstance(block.runtime, ImportSystem): + if isinstance(block.runtime, XMLImportingModuleStoreRuntime): return is_aside_applicable_to_block(block=block) return ( diff --git a/src/ol_openedx_chat/pyproject.toml b/src/ol_openedx_chat/pyproject.toml index deb90c54b..172b62e88 100644 --- a/src/ol_openedx_chat/pyproject.toml +++ b/src/ol_openedx_chat/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ol-openedx-chat" -version = "0.4.0" +version = "0.5.0" description = "An Open edX plugin to add Open Learning AI chat aside to xBlocks" authors = [ {name = "MIT Office of Digital Learning"} diff --git a/src/ol_openedx_chat/tests/test_aside.py b/src/ol_openedx_chat/tests/test_aside.py index 66059e66d..7f0eee74b 100644 --- a/src/ol_openedx_chat/tests/test_aside.py +++ b/src/ol_openedx_chat/tests/test_aside.py @@ -18,7 +18,13 @@ from openedx.core.djangolib.testing.utils import skip_unless_cms, skip_unless_lms from xblock.core import XBlockAside from xmodule.modulestore import ModuleStoreEnum -from xmodule.modulestore.xml import ImportSystem + +try: + from xmodule.modulestore.xml import ( + XMLImportingModuleStoreRuntime as XMLImportingModuleStoreRuntime, # noqa: PLC0414 + ) +except ImportError: + from xmodule.modulestore.xml import ImportSystem as XMLImportingModuleStoreRuntime from tests.utils import OLChatTestCase @@ -262,7 +268,7 @@ def test_should_apply_to_block( ) if is_import_runtime: - block.runtime = Mock(spec=ImportSystem) + block.runtime = Mock(spec=XMLImportingModuleStoreRuntime) aside_instance = ( self.problem_aside_instance