From d39b8ccfa98ebf0a53d0c64172df7b831860582a Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Mon, 7 May 2018 13:29:17 -0400 Subject: [PATCH 1/2] only check access of asked-for threads --- lms/djangoapps/discussion/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lms/djangoapps/discussion/views.py b/lms/djangoapps/discussion/views.py index 8fb90e1b67..318c19325f 100644 --- a/lms/djangoapps/discussion/views.py +++ b/lms/djangoapps/discussion/views.py @@ -153,10 +153,9 @@ 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 thread.get('commentable_id') in discussion_category_ids + if utils.discussion_category_id_access(course, request.user, thread.get('commentable_id'), thread) ] for thread in threads: From 9c63ff3d212632028631a35f5cf972931cfe2088 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Mon, 7 May 2018 15:25:25 -0400 Subject: [PATCH 2/2] Don't barf during debug logging, that's silly --- lms/djangoapps/django_comment_client/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/djangoapps/django_comment_client/utils.py b/lms/djangoapps/django_comment_client/utils.py index 24c928c349..514ec002f9 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, - xblock.location + getattr(xblock, 'location', None) ) return False return True