From f7a66eab784a022e1ea537e93beb32c2bb48fb42 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 9 May 2018 11:53:56 -0400 Subject: [PATCH] Revert "Merge pull request #18150 from edx/efischer/last_one_i_swear" This reverts commit fcef6b3f472c5ce5ed1291c03cc8a8703851ed54, reversing changes made to 0b11634e4cd57ec0d2e6cd3535bacdaaa1c1d13a. --- lms/djangoapps/discussion/views.py | 3 ++- lms/djangoapps/django_comment_client/utils.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/discussion/views.py b/lms/djangoapps/discussion/views.py index 318c19325f..8fb90e1b67 100644 --- a/lms/djangoapps/discussion/views.py +++ b/lms/djangoapps/discussion/views.py @@ -153,9 +153,10 @@ def get_threads(request, course, user_info, discussion_id=None, per_page=THREADS # If not provided with a discussion id, filter threads by commentable ids # which are accessible to the current user. if discussion_id is None: + discussion_category_ids = set(utils.get_discussion_categories_ids(course, request.user)) threads = [ thread for thread in threads - if utils.discussion_category_id_access(course, request.user, thread.get('commentable_id'), thread) + if thread.get('commentable_id') in discussion_category_ids ] for thread in threads: diff --git a/lms/djangoapps/django_comment_client/utils.py b/lms/djangoapps/django_comment_client/utils.py index 514ec002f9..24c928c349 100644 --- a/lms/djangoapps/django_comment_client/utils.py +++ b/lms/djangoapps/django_comment_client/utils.py @@ -110,7 +110,7 @@ def has_required_keys(xblock): log.debug( "Required key '%s' not in discussion %s, leaving out of category map", key, - getattr(xblock, 'location', None) + xblock.location ) return False return True