Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix AttributeError when LocMemCache uses in tests #2524

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cms/djangoapps/contentstore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2298,4 +2298,6 @@ def drop_course_sidebar_blocks_cache(course_id: str):
"""
Drop the course sidebar blocks cache for the given course.
"""
cache.delete_many(cache.iter_keys(f"course_sidebar_blocks_{course_id}*"))
cache_key_prefix = f"course_sidebar_blocks_{course_id}"
all_cache_keys = cache.keys('*') if hasattr(cache, 'keys') else []
cache.delete_many(filter(lambda key: key.startswith(cache_key_prefix), all_cache_keys))
Loading