From 91aec6d38f5bd2d4c4950fa1d3e7c950a65c241d Mon Sep 17 00:00:00 2001 From: Arjun Singh Date: Tue, 4 Sep 2012 09:55:18 -0700 Subject: [PATCH] Including courseware context in threads for non inline discussion --- lms/djangoapps/django_comment_client/forum/views.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lms/djangoapps/django_comment_client/forum/views.py b/lms/djangoapps/django_comment_client/forum/views.py index 4607cc10c5..03ee5a999a 100644 --- a/lms/djangoapps/django_comment_client/forum/views.py +++ b/lms/djangoapps/django_comment_client/forum/views.py @@ -71,6 +71,15 @@ def render_discussion(request, course_id, threads, *args, **kwargs): 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 = { 'threads': threads, 'discussion_id': discussion_id,