about summary refs log tree commit diff
path: root/app/models/admin
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-05-06 21:40:20 +0200
committerGitHub <noreply@github.com>2022-05-06 21:40:20 +0200
commita53003c6f18cd5b4177810e118b158290131b6ec (patch)
treeb3ea4bb5d20c765ee7062dda368da24a98d14196 /app/models/admin
parent9250578e6bfe805e81e65fc5d9684bac3503f189 (diff)
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
Diffstat (limited to 'app/models/admin')
-rw-r--r--app/models/admin/account_action.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/admin/account_action.rb b/app/models/admin/account_action.rb
index 850ea6d82..237975880 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!