Commit edf02dd9 by Arjun Singh

Fix context links for the 123187th time

parent 8f63ec4d
......@@ -112,6 +112,7 @@ def _create_comment(request, course_id, thread_id=None, parent_id=None):
post = request.POST
comment = cc.Comment(**extract(post, ['body']))
course = get_course_with_access(request.user, course_id, 'load')
if course.metadata.get("allow_anonymous", True):
anonymous = post.get('anonymous', 'false').lower() == 'true'
else:
......
......@@ -212,6 +212,8 @@ def single_thread(request, course_id, discussion_id, thread_id):
category_map = utils.get_discussion_category_map(course)
try:
threads, query_params = get_threads(request, course_id)
thread = cc.Thread.find(thread_id).retrieve(recursive=True)
threads.append(thread.to_dict())
except (cc.utils.CommentClientError, cc.utils.CommentClientUnknownError) as err:
raise Http404
......
......@@ -146,8 +146,9 @@ def initialize_discussion_info(course):
category = module.metadata['discussion_category']
title = module.metadata['for']
sort_key = module.metadata.get('sort_key', title)
discussion_id_map[id] = {"location": location, "title": title}
category = " / ".join([x.strip() for x in category.split("/")])
last_category = category.split("/")[-1]
discussion_id_map[id] = {"location": location, "title": last_category + " / " + title}
unexpanded_category_map[category].append({"title": title, "id": id,
"sort_key": sort_key, "start_date": module.start})
......@@ -333,7 +334,7 @@ def safe_content(content):
'endorsed', 'parent_id', 'thread_id', 'votes', 'closed', 'created_at',
'updated_at', 'depth', 'type', 'commentable_id', 'comments_count',
'at_position_list', 'children', 'highlighted_title', 'highlighted_body',
'courseware_title', 'courseware_location', 'tags'
'courseware_title', 'courseware_url', 'tags'
]
if (content.get('anonymous') is False) and (content.get('anonymous_to_peers') is False):
......
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