diff --git a/lms/djangoapps/discussion/django_comment_client/base/views.py b/lms/djangoapps/discussion/django_comment_client/base/views.py index 458b0a02857e..1343811dc1eb 100644 --- a/lms/djangoapps/discussion/django_comment_client/base/views.py +++ b/lms/djangoapps/discussion/django_comment_client/base/views.py @@ -367,6 +367,7 @@ def track_comment_reported_event(request, course, comment): obj_type = 'comment' if comment.get('parent_id') else 'response' event_name = _EVENT_NAME_TEMPLATE.format(obj_type=obj_type, action_name='reported') event_data = { + 'discussion': {'id': comment.thread_id}, 'body': comment.body[:TRACKING_MAX_FORUM_BODY], 'truncated': len(comment.body) > TRACKING_MAX_FORUM_BODY, 'commentable_id': comment.get('commentable_id', ''), @@ -405,6 +406,7 @@ def track_comment_unreported_event(request, course, comment): obj_type = 'comment' if comment.get('parent_id') else 'response' event_name = _EVENT_NAME_TEMPLATE.format(obj_type=obj_type, action_name='unreported') event_data = { + 'discussion': {'id': comment.thread_id}, 'body': comment.body[:TRACKING_MAX_FORUM_BODY], 'truncated': len(comment.body) > TRACKING_MAX_FORUM_BODY, 'commentable_id': comment.get('commentable_id', ''), diff --git a/lms/djangoapps/discussion/rest_api/tests/test_api_v2.py b/lms/djangoapps/discussion/rest_api/tests/test_api_v2.py index 4804c73a069f..18dd8e2caf8f 100644 --- a/lms/djangoapps/discussion/rest_api/tests/test_api_v2.py +++ b/lms/djangoapps/discussion/rest_api/tests/test_api_v2.py @@ -840,6 +840,7 @@ def test_abuse_flagged(self, old_flagged, new_flagged, mock_emit): else "edx.forum.response.unreported" ) expected_event_data = { + "discussion": {'id': 'test_thread'}, "body": "Original body", "id": "test_comment", "content_type": "Response", @@ -902,6 +903,7 @@ def test_comment_un_abuse_flag_for_moderator_role( "body": "Original body", "id": "test_comment", "content_type": "Response", + "discussion": {'id': 'test_thread'}, "commentable_id": "dummy", "truncated": False, "url": "",