From e5f698a5a744a7e818a30542638113bbde9bacc7 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Mon, 29 Jul 2024 14:04:08 -0400 Subject: [PATCH] feat: Remove the unused `StubModel` class. Now that the model backed cache is on by default, we don't need to keep the StubModel object around. --- .../content/block_structure/store.py | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/openedx/core/djangoapps/content/block_structure/store.py b/openedx/core/djangoapps/content/block_structure/store.py index 08a4f4acf5..37a2b57449 100644 --- a/openedx/core/djangoapps/content/block_structure/store.py +++ b/openedx/core/djangoapps/content/block_structure/store.py @@ -19,26 +19,6 @@ from .transformer_registry import TransformerRegistry logger = getLogger(__name__) # pylint: disable=C0103 -class StubModel: - """ - Stub model to use when storage backing is disabled. - By using this stub, we eliminate the need for extra - conditional statements in the code. - """ - - def __init__(self, root_block_usage_key): - self.data_usage_key = root_block_usage_key - - def __str__(self): - return str(self.data_usage_key) - - def delete(self): - """ - Noop delete method. - """ - pass # lint-amnesty, pylint: disable=unnecessary-pass - - class BlockStructureStore: """ Storage for BlockStructure objects. @@ -216,7 +196,7 @@ class BlockStructureStore: def _encode_root_cache_key(bs_model): """ Returns the cache key to use for the given - BlockStructureModel or StubModel. + BlockStructureModel. """ return str(bs_model)