Discussion consolidation: review comments

This commit is contained in:
Nimisha Asthagiri
2019-05-01 19:11:13 -04:00
parent df962a31b7
commit 31e9219c89
2 changed files with 4 additions and 4 deletions

View File

@@ -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)

View File

@@ -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)