Fix delete cache so it also deletes location with run = None.

This commit is contained in:
Nimisha Asthagiri
2014-05-09 14:10:59 -04:00
parent 660f905028
commit e9052dc2fb

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)]]
)