]> cat aescling's git repositories - mastodon.git/commitdiff
Fix account warnings not being recorded in audit log (#18338)
authorClaire <claire.github-309c@sitedethib.com>
Fri, 6 May 2022 19:40:20 +0000 (21:40 +0200)
committersingle-right-quote <11325618-aescling@users.noreply.gitlab.com>
Fri, 27 May 2022 03:32:55 +0000 (23:32 -0400)
* 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

index 850ea6d82342255f6ac0b0ce46965b7a20118f4b..237975880129f6095e1120734539a4651106908c 100644 (file)
@@ -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!