From 1d7f891145aeff29a612e98dc0d4916aa7ff79f1 Mon Sep 17 00:00:00 2001 From: cahrens Date: Wed, 25 Sep 2013 15:24:50 -0400 Subject: [PATCH] Delete asset from cache. --- cms/djangoapps/contentstore/views/assets.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/views/assets.py b/cms/djangoapps/contentstore/views/assets.py index ea2ee16969..4f9db0bf4d 100644 --- a/cms/djangoapps/contentstore/views/assets.py +++ b/cms/djangoapps/contentstore/views/assets.py @@ -201,7 +201,11 @@ def update_asset(request, org, course, name, asset_id): # method-- just changing the locked state. modified_asset = json.loads(request.body) asset_id = modified_asset['url'] - contentstore().set_attr(get_asset_location(asset_id), 'locked', modified_asset['locked']) + location = get_asset_location(asset_id) + contentstore().set_attr(location, 'locked', modified_asset['locked']) + # Delete the asset from the cache so we check the lock status the next time it is requested. + del_cached_content(location) + return JsonResponse(modified_asset, status=201)