fix!: supply the editor and closing user as separate params to cs_comments_service (#30230)

The forum service doesn't get the requesting user id for any operation, only the user id of the content creator. So to apply a different user id for an editor or post closing user, those need to be explicitly passed.
This commit is contained in:
Kshitij Sobti
2022-04-14 16:51:55 +05:30
committed by GitHub
parent 2523d56d40
commit 1ea90d8843
6 changed files with 56 additions and 9 deletions

View File

@@ -20,6 +20,7 @@ class Comment(models.Model):
updatable_fields = [
'body', 'anonymous', 'anonymous_to_peers', 'course_id', 'closed',
'user_id', 'endorsed', 'endorsement_user_id', 'edit_reason_code',
'closing_user_id', 'editing_user_id',
]
initializable_fields = updatable_fields

View File

@@ -28,7 +28,7 @@ class Thread(models.Model):
updatable_fields = [
'title', 'body', 'anonymous', 'anonymous_to_peers', 'course_id', 'read',
'closed', 'user_id', 'commentable_id', 'group_id', 'group_name', 'pinned', 'thread_type',
'close_reason_code', 'edit_reason_code',
'close_reason_code', 'edit_reason_code', 'closing_user_id', 'editing_user_id',
]
# metric_tag_fields are used by Datadog to record metrics about the model