fix: added thread id in comment/response reported event (#37276)
Co-authored-by: Ayesha Waris <ayesha.waris@A006-01000.local>
This commit is contained in:
@@ -378,6 +378,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', ''),
|
||||
@@ -416,6 +417,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', ''),
|
||||
|
||||
@@ -896,6 +896,7 @@ class UpdateCommentTest(
|
||||
else "edx.forum.response.unreported"
|
||||
)
|
||||
expected_event_data = {
|
||||
"discussion": {'id': 'test_thread'},
|
||||
"body": "Original body",
|
||||
"id": "test_comment",
|
||||
"content_type": "Response",
|
||||
@@ -958,6 +959,7 @@ class UpdateCommentTest(
|
||||
"body": "Original body",
|
||||
"id": "test_comment",
|
||||
"content_type": "Response",
|
||||
"discussion": {'id': 'test_thread'},
|
||||
"commentable_id": "dummy",
|
||||
"truncated": False,
|
||||
"url": "",
|
||||
|
||||
Reference in New Issue
Block a user