Merge pull request #3668 from edx/opaque-keys-fix-cache-content-diff-runs

Fix delete cache so it also deletes location with run = None.
This commit is contained in:
Nimisha Asthagiri
2014-05-09 14:36:48 -04:00

View File

@@ -118,4 +118,9 @@ def get_cached_content(location):
def del_cached_content(location):
cache.delete(unicode(location).encode("utf-8"))
# delete content for the given location, as well as for content with run=None.
# it's possible that the content could have been cached without knowing the
# course_key - and so without having the run.
cache.delete_many(
[unicode(loc).encode("utf-8") for loc in [location, location.replace(run=None)]]
)