Skip to content

Commit

Permalink
feat: Remove the unused StubModel class.
Browse files Browse the repository at this point in the history
Now that the model backed cache is on by default, we don't need to keep
the StubModel object around.
  • Loading branch information
feanil committed Aug 13, 2024
1 parent 0de4d77 commit 051ae21
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions openedx/core/djangoapps/content/block_structure/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,6 @@
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.
Expand Down Expand Up @@ -216,7 +196,7 @@ def _deserialize(self, serialized_data, root_block_usage_key):
def _encode_root_cache_key(bs_model):
"""
Returns the cache key to use for the given
BlockStructureModel or StubModel.
BlockStructureModel.
"""
return str(bs_model)

Expand Down

0 comments on commit 051ae21

Please sign in to comment.