Pass XBlock parents down to their children when constructing them, for caching

This commit is contained in:
Calen Pennington
2015-06-17 18:33:40 -04:00
parent 324d4785c1
commit fdf81042f5
14 changed files with 145 additions and 86 deletions

View File

@@ -560,7 +560,12 @@ class CourseBlocksAndNavigation(ListAPIView):
)
# verify the user has access to this block
if not has_access(request_info.request.user, 'load', block_info.block, course_key=request_info.course.id):
if (block_info.block is None or not has_access(
request_info.request.user,
'load',
block_info.block,
course_key=request_info.course.id
)):
return
# add the block's value to the result