From 31e9219c89839e1726039042e1c19ff1aa496d7e Mon Sep 17 00:00:00 2001 From: Nimisha Asthagiri Date: Wed, 1 May 2019 19:11:13 -0400 Subject: [PATCH] Discussion consolidation: review comments --- .../discussion/django_comment_client/base/views.py | 2 +- .../djangoapps/discussion_common/comment_client/thread.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lms/djangoapps/discussion/django_comment_client/base/views.py b/lms/djangoapps/discussion/django_comment_client/base/views.py index 24c1cafc3d..20d553f7ec 100644 --- a/lms/djangoapps/discussion/django_comment_client/base/views.py +++ b/lms/djangoapps/discussion/django_comment_client/base/views.py @@ -99,7 +99,7 @@ def track_created_event(request, event_name, course, obj, data): """ Send analytics event for a newly created thread, response or comment. """ - data['truncated'] = bool(len(obj.body) > TRACKING_MAX_FORUM_BODY) + data['truncated'] = len(obj.body) > TRACKING_MAX_FORUM_BODY data['body'] = obj.body[:TRACKING_MAX_FORUM_BODY] track_forum_event(request, event_name, course, obj, data) diff --git a/openedx/core/djangoapps/discussion_common/comment_client/thread.py b/openedx/core/djangoapps/discussion_common/comment_client/thread.py index 7d86dbd799..d45a385f9e 100644 --- a/openedx/core/djangoapps/discussion_common/comment_client/thread.py +++ b/openedx/core/djangoapps/discussion_common/comment_client/thread.py @@ -1,4 +1,4 @@ -# pylint: disable=missing-docstring,protected-access,unused-argument +# pylint: disable=missing-docstring,protected-access import logging from eventtracking import tracker @@ -123,7 +123,7 @@ class Thread(models.Model): return u"{prefix}/threads".format(prefix=settings.PREFIX) @classmethod - def url_for_search_threads(cls, params=None): + def url_for_search_threads(cls): return "{prefix}/search/threads".format(prefix=settings.PREFIX) @classmethod @@ -133,7 +133,7 @@ class Thread(models.Model): if action in ['get_all', 'post']: return cls.url_for_threads(params) elif action == 'search': - return cls.url_for_search_threads(params) + return cls.url_for_search_threads() else: return super(Thread, cls).url(action, params)