diff --git a/openedx/core/djangoapps/content/block_structure/config/__init__.py b/openedx/core/djangoapps/content/block_structure/config/__init__.py index 194dfa9ee2..9bac61bf9b 100644 --- a/openedx/core/djangoapps/content/block_structure/config/__init__.py +++ b/openedx/core/djangoapps/content/block_structure/config/__init__.py @@ -48,24 +48,6 @@ STORAGE_BACKING_FOR_CACHE = WaffleSwitch( "block_structure.storage_backing_for_cache", __name__ ) -# .. toggle_name: block_structure.raise_error_when_not_found -# .. toggle_implementation: WaffleSwitch -# .. toggle_default: False -# .. toggle_description: Raises an error if the requested block structure does not exist in block -# structure store, or if it is outdated. Block structure store refers to both cache and storage, -# if enabled. -# .. toggle_warning: This switch will likely be deprecated and removed. -# The annotation will be updated with the DEPR ticket once that process has started. -# .. toggle_use_cases: temporary -# .. toggle_creation_date: 2017-02-23 -# .. toggle_target_removal_date: 2017-05-23 -# .. toggle_tickets: https://github.com/openedx/edx-platform/pull/14512, -# https://github.com/openedx/edx-platform/pull/14770, -# https://openedx.atlassian.net/browse/DEPR-143 -RAISE_ERROR_WHEN_NOT_FOUND = WaffleSwitch( - "block_structure.raise_error_when_not_found", __name__ -) - def enable_storage_backing_for_cache_in_request(): """ diff --git a/openedx/core/djangoapps/content/block_structure/manager.py b/openedx/core/djangoapps/content/block_structure/manager.py index e063ed7a35..2f8a041c31 100644 --- a/openedx/core/djangoapps/content/block_structure/manager.py +++ b/openedx/core/djangoapps/content/block_structure/manager.py @@ -6,7 +6,6 @@ BlockStructures. from contextlib import contextmanager -from . import config from .exceptions import BlockStructureNotFound, TransformerDataIncompatible, UsageKeyNotInBlockStructure from .factory import BlockStructureFactory from .store import BlockStructureStore @@ -100,8 +99,6 @@ class BlockStructureManager: BlockStructureTransformers.verify_versions(block_structure) except (BlockStructureNotFound, TransformerDataIncompatible): - if config.RAISE_ERROR_WHEN_NOT_FOUND.is_enabled(): - raise block_structure = self._update_collected() return block_structure diff --git a/openedx/core/djangoapps/content/block_structure/tests/test_manager.py b/openedx/core/djangoapps/content/block_structure/tests/test_manager.py index a96f8e5bc8..a7ff603a8c 100644 --- a/openedx/core/djangoapps/content/block_structure/tests/test_manager.py +++ b/openedx/core/djangoapps/content/block_structure/tests/test_manager.py @@ -8,7 +8,7 @@ from django.test import TestCase from edx_toggles.toggles.testutils import override_waffle_switch from ..block_structure import BlockStructureBlockData -from ..config import RAISE_ERROR_WHEN_NOT_FOUND, STORAGE_BACKING_FOR_CACHE +from ..config import STORAGE_BACKING_FOR_CACHE from ..exceptions import BlockStructureNotFound, UsageKeyNotInBlockStructure from ..manager import BlockStructureManager from ..transformers import BlockStructureTransformers @@ -177,12 +177,6 @@ class TestBlockStructureManager(UsageKeyFactoryMixin, ChildrenMapTestMixin, Test self.collect_and_verify(expect_modulestore_called=False, expect_cache_updated=False) assert TestTransformer1.collect_call_count == 1 - def test_get_collected_error_raised(self): - with override_waffle_switch(RAISE_ERROR_WHEN_NOT_FOUND, active=True): - with mock_registered_transformers(self.registered_transformers): - with pytest.raises(BlockStructureNotFound): - self.bs_manager.get_collected() - @ddt.data(True, False) def test_update_collected_if_needed(self, with_storage_backing): with override_waffle_switch(STORAGE_BACKING_FOR_CACHE, active=with_storage_backing):