diff --git a/lms/djangoapps/django_comment_client/base/views.py b/lms/djangoapps/django_comment_client/base/views.py index 6734625a76..c021458ae3 100644 --- a/lms/djangoapps/django_comment_client/base/views.py +++ b/lms/djangoapps/django_comment_client/base/views.py @@ -116,6 +116,9 @@ def create_thread(request, course_id, commentable_id): thread.save() + #patch for backward compatibility with comments service + thread['pinned'] = False + if post.get('auto_subscribe', 'false').lower() == 'true': user = cc.User.from_django_user(request.user) user.follow(thread) diff --git a/lms/djangoapps/django_comment_client/forum/views.py b/lms/djangoapps/django_comment_client/forum/views.py index 50224e7de6..bb59a5675a 100644 --- a/lms/djangoapps/django_comment_client/forum/views.py +++ b/lms/djangoapps/django_comment_client/forum/views.py @@ -98,6 +98,9 @@ def get_threads(request, course_id, discussion_id=None, per_page=THREADS_PER_PAG else: thread['group_name'] = "" thread['group_string'] = "This post visible to everyone." + + #temporary patch for backward compatibility to comments service + thread['pinning'] = False query_params['page'] = page query_params['num_pages'] = num_pages @@ -245,6 +248,10 @@ def single_thread(request, course_id, discussion_id, thread_id): try: thread = cc.Thread.find(thread_id).retrieve(recursive=True, user_id=request.user.id) + + #temporary patch for backward compatibility with comments service + thread["pinned"] = False + except (cc.utils.CommentClientError, cc.utils.CommentClientUnknownError) as err: log.error("Error loading single thread.") raise Http404 @@ -285,6 +292,9 @@ def single_thread(request, course_id, discussion_id, thread_id): if thread.get('group_id') and not thread.get('group_name'): thread['group_name'] = get_cohort_by_id(course_id, thread.get('group_id')).name + #temporary patch for backward compatibility with comments service + thread["pinned"] = False + threads = [utils.safe_content(thread) for thread in threads] #recent_active_threads = cc.search_recent_active_threads( diff --git a/lms/templates/discussion/_underscore_templates.html b/lms/templates/discussion/_underscore_templates.html index 5fdfb8aa82..21a881908f 100644 --- a/lms/templates/discussion/_underscore_templates.html +++ b/lms/templates/discussion/_underscore_templates.html @@ -45,11 +45,17 @@
${'<%- body %>'}
- - % if course and has_permission(user, 'openclose_thread', course.id): + + % if course and has_permission(user, 'openclose_thread', course.id) and False:
Pin Thread
- %else: + + + %elif False: ${"<% if (pinned) { %>"}
Pin Thread