mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Compare commits
2 commits
f9c762ecc4
...
c47d141748
Author | SHA1 | Date | |
---|---|---|---|
|
c47d141748 | ||
|
f344c4d0ff |
2 changed files with 2 additions and 2 deletions
|
@ -16,6 +16,6 @@ module RegistrationHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def ip_blocked?(remote_ip)
|
def ip_blocked?(remote_ip)
|
||||||
IpBlock.where(severity: :sign_up_block).exists?(['ip >>= ?', remote_ip.to_s])
|
IpBlock.severity_sign_up_block.exists?(['ip >>= ?', remote_ip.to_s])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -36,7 +36,7 @@ class IpBlock < ApplicationRecord
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def blocked?(remote_ip)
|
def blocked?(remote_ip)
|
||||||
blocked_ips_map = Rails.cache.fetch(CACHE_KEY) { FastIpMap.new(IpBlock.where(severity: :no_access).pluck(:ip)) }
|
blocked_ips_map = Rails.cache.fetch(CACHE_KEY) { FastIpMap.new(severity_no_access.pluck(:ip)) }
|
||||||
blocked_ips_map.include?(remote_ip)
|
blocked_ips_map.include?(remote_ip)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue