From 0e0b96b8e794fc87264e3b9470f80c10cc652a01 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 6 May 2022 21:40:20 +0200 Subject: [PATCH] Fix account warnings not being recorded in audit log (#18338) * Fix account warnings not being recorded in audit log Fixes #18334 * Only record warnings if they are not associated to another action --- app/models/admin/account_action.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/admin/account_action.rb b/app/models/admin/account_action.rb index 850ea6d823..2379758801 100644 --- a/app/models/admin/account_action.rb +++ b/app/models/admin/account_action.rb @@ -92,6 +92,10 @@ class Admin::AccountAction text: text_for_warning, status_ids: status_ids ) + + # 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 process_reports!