Reinstate action logging (#38211)

This commit is contained in:
David Roetzel
2026-03-16 09:42:06 +01:00
committed by GitHub
parent f561014aa8
commit 2f989c780a
2 changed files with 24 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ class Admin::AccountAction < Admin::BaseAction
ApplicationRecord.transaction do
handle_type!
process_strike!
create_log!
process_reports!
end
@@ -105,6 +106,12 @@ class Admin::AccountAction < Admin::BaseAction
target_account.suspend!(origin: :local)
end
def create_log!
# A log entry is only interesting if the warning contains
# custom text from someone. Otherwise it's just noise.
log_action(:create, @warning) if @warning&.text.present? && type == 'none'
end
def text_for_warning
[warning_preset&.text, text].compact.join("\n\n")
end