mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add rubocop to our build. (#5004)
This commit is contained in:
@@ -4,15 +4,15 @@ class SpamHandler
|
||||
return false if SiteSetting.max_new_accounts_per_registration_ip <= 0
|
||||
|
||||
tl2_plus_accounts_with_same_ip = User.where("trust_level >= ?", TrustLevel[2])
|
||||
.where(ip_address: ip_address.to_s)
|
||||
.count
|
||||
.where(ip_address: ip_address.to_s)
|
||||
.count
|
||||
|
||||
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)
|
||||
.where(ip_address: ip_address.to_s)
|
||||
.count
|
||||
.where(ip_address: ip_address.to_s)
|
||||
.count
|
||||
|
||||
return false if staff_members_with_same_ip > 0
|
||||
|
||||
@@ -20,9 +20,9 @@ class SpamHandler
|
||||
return false if ip_whitelisted
|
||||
|
||||
tl0_accounts_with_same_ip = User.unscoped
|
||||
.where(trust_level: TrustLevel[0])
|
||||
.where(ip_address: ip_address.to_s)
|
||||
.count
|
||||
.where(trust_level: TrustLevel[0])
|
||||
.where(ip_address: ip_address.to_s)
|
||||
.count
|
||||
|
||||
tl0_accounts_with_same_ip >= SiteSetting.max_new_accounts_per_registration_ip
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user