Commit 87fc2eb3 by Arjun Singh

Including courseware context in threads for non inline discussion

parent 8c9fbe5b
...@@ -71,6 +71,15 @@ def render_discussion(request, course_id, threads, *args, **kwargs): ...@@ -71,6 +71,15 @@ def render_discussion(request, course_id, threads, *args, **kwargs):
annotated_content_info = reduce(merge_dict, map(infogetter, threads), {}) annotated_content_info = reduce(merge_dict, map(infogetter, threads), {})
if discussion_type != 'inline':
course = get_course_with_access(request.user, course_id, 'load')
for thread in threads:
courseware_context = get_courseware_context(thread, course)
if courseware_context:
thread['courseware_location'] = courseware_context['courseware_location']
thread['courseware_title'] = courseware_context['courseware_title']
context = { context = {
'threads': threads, 'threads': threads,
'discussion_id': discussion_id, 'discussion_id': discussion_id,
......
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