From 8336c7f9b52c6612ae57eb4aa0508fe8bdf034d9 Mon Sep 17 00:00:00 2001 From: Maxim Beder Date: Fri, 21 Oct 2022 11:43:48 +0200 Subject: [PATCH] refactor: remove unused StudioEditableModule --- xmodule/library_root_xblock.py | 4 ++-- xmodule/studio_editable.py | 5 +---- xmodule/tests/test_studio_editable.py | 6 +++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/xmodule/library_root_xblock.py b/xmodule/library_root_xblock.py index 32581330aa..97ec88aed6 100644 --- a/xmodule/library_root_xblock.py +++ b/xmodule/library_root_xblock.py @@ -8,7 +8,7 @@ import logging from web_fragments.fragment import Fragment from xblock.core import XBlock from xblock.fields import Boolean, List, Scope, String -from xmodule.studio_editable import StudioEditableModule +from xmodule.studio_editable import StudioEditableBlock log = logging.getLogger(__name__) @@ -87,7 +87,7 @@ class LibraryRoot(XBlock): child_context['show_preview'] = self.show_children_previews child_context['can_edit_visibility'] = False child = self.runtime.get_block(child_key) - child_view_name = StudioEditableModule.get_preview_view_name(child) + child_view_name = StudioEditableBlock.get_preview_view_name(child) if str(child.location) == force_render: child_context['show_preview'] = True diff --git a/xmodule/studio_editable.py b/xmodule/studio_editable.py index f222851dc3..287d72bab7 100644 --- a/xmodule/studio_editable.py +++ b/xmodule/studio_editable.py @@ -25,7 +25,7 @@ class StudioEditableBlock(XBlockMixin): if can_reorder: context['reorderable_items'].add(child.location) context['can_add'] = can_add - rendered_child = child.render(StudioEditableModule.get_preview_view_name(child), context) + rendered_child = child.render(StudioEditableBlock.get_preview_view_name(child), context) fragment.add_fragment_resources(rendered_child) contents.append({ @@ -48,9 +48,6 @@ class StudioEditableBlock(XBlockMixin): return AUTHOR_VIEW if has_author_view(block) else STUDENT_VIEW -StudioEditableModule = StudioEditableBlock - - def has_author_view(descriptor): """ Returns True if the xmodule linked to the descriptor supports "author_view". diff --git a/xmodule/tests/test_studio_editable.py b/xmodule/tests/test_studio_editable.py index cd985ccaff..f697cf8249 100644 --- a/xmodule/tests/test_studio_editable.py +++ b/xmodule/tests/test_studio_editable.py @@ -1,5 +1,5 @@ """ -Tests for StudioEditableModule. +Tests for StudioEditableBlock. """ @@ -7,9 +7,9 @@ from xmodule.tests.test_vertical import BaseVerticalBlockTest from xmodule.x_module import AUTHOR_VIEW -class StudioEditableModuleTestCase(BaseVerticalBlockTest): +class StudioEditableBlockTestCase(BaseVerticalBlockTest): """ - Class containing StudioEditableModule tests. + Class containing StudioEditableBlock tests. """ def test_render_reorderable_children(self):