Hotfix for BlockStructure data not being invalidated upon Course Publish.

This commit is contained in:
Nimisha Asthagiri
2016-05-20 14:37:11 -04:00
parent 01fca6b67d
commit d37499c29d
3 changed files with 15 additions and 5 deletions

View File

@@ -96,3 +96,13 @@ def update_course_structure(course_key):
structure_model.structure_json = structure_json
structure_model.discussion_id_map_json = discussion_id_map_json
structure_model.save()
# TODO (TNL-4630) For temporary hotfix to update the block_structure cache.
# Should be moved to proper location.
from django.core.cache import cache
from openedx.core.lib.block_structure.manager import BlockStructureManager
store = modulestore()
course_usage_key = store.make_course_usage_key(course_key)
block_structure_manager = BlockStructureManager(course_usage_key, store, cache)
block_structure_manager.update_collected()