From 378d1eb16b20ef778d6b1f4e40b0b443344f5bcd Mon Sep 17 00:00:00 2001 From: Jillian Vogel Date: Tue, 29 Oct 2024 16:38:27 +1030 Subject: [PATCH] fix: remove the "Legacy Library" button if libraries v1 are disabled --- cms/djangoapps/contentstore/views/component.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/views/component.py b/cms/djangoapps/contentstore/views/component.py index 46f2dd322efa..6767467e20f4 100644 --- a/cms/djangoapps/contentstore/views/component.py +++ b/cms/djangoapps/contentstore/views/component.py @@ -26,7 +26,12 @@ from common.djangoapps.xblock_django.api import authorable_xblocks, disabled_xblocks from common.djangoapps.xblock_django.models import XBlockStudioConfigurationFlag from cms.djangoapps.contentstore.helpers import is_unit -from cms.djangoapps.contentstore.toggles import libraries_v2_enabled, use_new_problem_editor, use_new_unit_page +from cms.djangoapps.contentstore.toggles import ( + libraries_v1_enabled, + libraries_v2_enabled, + use_new_problem_editor, + use_new_unit_page, +) from cms.djangoapps.contentstore.xblock_storage_handlers.view_handlers import load_services_for_studio from openedx.core.lib.xblock_utils import get_aside_from_xblock, is_xblock_aside from openedx.core.djangoapps.discussions.models import DiscussionsConfiguration @@ -488,6 +493,8 @@ def _filter_disabled_blocks(all_blocks): Filter out disabled xblocks from the provided list of xblock names. """ disabled_block_names = [block.name for block in disabled_xblocks()] + if not libraries_v1_enabled(): + disabled_block_names.append('library') if not libraries_v2_enabled(): disabled_block_names.append('library_v2') disabled_block_names.append('itembank')