mirror of
https://github.com/discourse/discourse.git
synced 2026-07-29 15:54:48 -05:00
FEATURE: Log Staff edits in Staff Action Logs
Why? Some edits by staff are not tracked. For example, during the grace period, or via the flags/silence dialog. If a staff member is editing someone else's post, it now goes into the Staff Action Logs so it can be audited by other staff members.
This commit is contained in:
@@ -177,6 +177,14 @@ class PostRevisor
|
||||
PostLocker.new(@post, @editor).lock
|
||||
end
|
||||
|
||||
# We log staff edits to posts
|
||||
if @editor.staff? && @editor.id != @post.user.id && @fields.has_key?('raw')
|
||||
StaffActionLogger.new(@editor).log_post_edit(
|
||||
@post,
|
||||
new_raw: @fields['raw']
|
||||
)
|
||||
end
|
||||
|
||||
# WARNING: do not pull this into the transaction
|
||||
# it can fire events in sidekiq before the post is done saving
|
||||
# leading to corrupt state
|
||||
|
||||
Reference in New Issue
Block a user