DEV: Avoid an additional query in `SpamHandler`.

DEV: Avoid an additional query in SpamHandler.

  • Also run query against human users only
diff --git a/lib/spam_handler.rb b/lib/spam_handler.rb
index 77e189f..2071c07 100644
--- a/lib/spam_handler.rb
+++ b/lib/spam_handler.rb
@@ -11,8 +11,7 @@ class SpamHandler
 
     return false if tl2_plus_accounts_with_same_ip > 0
 
-    staff_user_ids = Group[:staff].user_ids - [-1]
-    staff_members_with_same_ip = User.where(id: staff_user_ids)
+    staff_members_with_same_ip = Group[:staff].users.human_users
       .where(ip_address: ip_address.to_s)
       .count
 

GitHub sha: 76fc48b3