Commit d759270d by Bessie Steinberg Committed by Bill Filler

call milestone

parent 0bf46438
......@@ -33,21 +33,25 @@ class CourseOutlineFragmentView(EdxFragmentView):
if not course_block_tree:
return None
section = course_block_tree.get('children')[0]
has_prereq = {}
for subsection in section.get('children'):
# get_course_content_milestones(course_id, content_id, relationship, user_id=None)
has_prereq[subsection.get('id')] = get_course_content_milestones(
course_id=course_key,
content_id=subsection.get('id'),
relationship='requires',
user_id=request.user.id)
block_id_0 = course_block_tree.get('children')[0].get('children')[0].get('id')
prereq_0 = get_course_content_milestones(
course_id=course_key,
content_id=block_id,
relationship='requires',
user_id=request.user.id)
block_id_1 = course_block_tree.get('children')[0].get('children')[1].get('id')
prereq_1 = get_course_content_milestones(
course_id=course_key,
content_id=block_id,
relationship='requires',
user_id=request.user.id)
context = {
'csrf': csrf(request)['csrf_token'],
'course': course_overview,
'blocks': course_block_tree,
'has_prereq': has_prereq
'blocks': course_block_tree #,
# 'has_prereq': has_prereq
}
html = render_to_string('course_experience/course-outline-fragment.html', context)
return Fragment(html)
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