Skip to content

Commit 58d0839

Browse files
ayesha-warisAyesha Waris
andauthored
fix: added thread id in comment/response reported event (#37276)
Co-authored-by: Ayesha Waris <[email protected]>
1 parent 053abe3 commit 58d0839

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

lms/djangoapps/discussion/django_comment_client/base/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ def track_comment_reported_event(request, course, comment):
378378
obj_type = 'comment' if comment.get('parent_id') else 'response'
379379
event_name = _EVENT_NAME_TEMPLATE.format(obj_type=obj_type, action_name='reported')
380380
event_data = {
381+
'discussion': {'id': comment.thread_id},
381382
'body': comment.body[:TRACKING_MAX_FORUM_BODY],
382383
'truncated': len(comment.body) > TRACKING_MAX_FORUM_BODY,
383384
'commentable_id': comment.get('commentable_id', ''),
@@ -416,6 +417,7 @@ def track_comment_unreported_event(request, course, comment):
416417
obj_type = 'comment' if comment.get('parent_id') else 'response'
417418
event_name = _EVENT_NAME_TEMPLATE.format(obj_type=obj_type, action_name='unreported')
418419
event_data = {
420+
'discussion': {'id': comment.thread_id},
419421
'body': comment.body[:TRACKING_MAX_FORUM_BODY],
420422
'truncated': len(comment.body) > TRACKING_MAX_FORUM_BODY,
421423
'commentable_id': comment.get('commentable_id', ''),

lms/djangoapps/discussion/rest_api/tests/test_api_v2.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,7 @@ def test_abuse_flagged(self, old_flagged, new_flagged, mock_emit):
896896
else "edx.forum.response.unreported"
897897
)
898898
expected_event_data = {
899+
"discussion": {'id': 'test_thread'},
899900
"body": "Original body",
900901
"id": "test_comment",
901902
"content_type": "Response",
@@ -958,6 +959,7 @@ def test_comment_un_abuse_flag_for_moderator_role(
958959
"body": "Original body",
959960
"id": "test_comment",
960961
"content_type": "Response",
962+
"discussion": {'id': 'test_thread'},
961963
"commentable_id": "dummy",
962964
"truncated": False,
963965
"url": "",

0 commit comments

Comments
 (0)