Commit c33c782f by John Eskew

Wrap _invoke_xblock_handler in a bulk_op.

parent 6d7944fa
......@@ -908,6 +908,13 @@ def _invoke_xblock_handler(request, course_id, usage_id, handler, suffix):
if error_msg:
return JsonResponse(object={'success': error_msg}, status=413)
# Make a CourseKey from the course_id, raising a 404 upon parse error.
try:
course_key = CourseKey.from_string(course_id)
except InvalidKeyError:
raise Http404
with modulestore().bulk_operations(course_key):
instance, tracking_context = get_module_by_usage_id(request, course_id, usage_id)
# Name the transaction so that we can view XBlock handlers separately in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment