Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/ol_openedx_chat/ol_openedx_chat/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion src/ol_openedx_chat/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"}
Expand Down
10 changes: 8 additions & 2 deletions src/ol_openedx_chat/tests/test_aside.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down