diff --git a/lms/djangoapps/django_comment_client/base/views.py b/lms/djangoapps/django_comment_client/base/views.py index 604fe60282..17b9696a72 100644 --- a/lms/djangoapps/django_comment_client/base/views.py +++ b/lms/djangoapps/django_comment_client/base/views.py @@ -107,7 +107,7 @@ def create_thread(request, course_id, commentable_id): # else: # regular users always post with their own id. # group_id = user_group_id - if post['group_id']: + if 'group_id' in post.keys(): thread.update_attributes(group_id=post['group_id']) thread.save() diff --git a/lms/djangoapps/django_comment_client/forum/views.py b/lms/djangoapps/django_comment_client/forum/views.py index 48022168b1..a9f073ccea 100644 --- a/lms/djangoapps/django_comment_client/forum/views.py +++ b/lms/djangoapps/django_comment_client/forum/views.py @@ -72,6 +72,12 @@ def get_threads(request, course_id, discussion_id=None, per_page=THREADS_PER_PAG 'tags', 'commentable_ids']))) threads, page, num_pages = cc.Thread.search(query_params) + + #now add the group name if the thread has a group id + for thread in threads: + 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 + query_params['page'] = page query_params['num_pages'] = num_pages