mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
DEV: Avoid an additional query in SpamHandler
.
* Also run query against human users only
This commit is contained in:
parent
e0725fd123
commit
76fc48b318
@ -11,8 +11,7 @@ class SpamHandler
|
|||||||
|
|
||||||
return false if tl2_plus_accounts_with_same_ip > 0
|
return false if tl2_plus_accounts_with_same_ip > 0
|
||||||
|
|
||||||
staff_user_ids = Group[:staff].user_ids - [-1]
|
staff_members_with_same_ip = Group[:staff].users.human_users
|
||||||
staff_members_with_same_ip = User.where(id: staff_user_ids)
|
|
||||||
.where(ip_address: ip_address.to_s)
|
.where(ip_address: ip_address.to_s)
|
||||||
.count
|
.count
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user