bugfixes and reforms to block filters

This commit is contained in:
Kyle Drake 2019-02-03 21:53:48 -08:00
parent 687a134207
commit 6f7a6098a4
5 changed files with 38 additions and 3 deletions

View file

@ -1,4 +1,4 @@
class Block < Sequel::Model
many_to_one :site
many_to_one :actioning_site, class: :Block
end
many_to_one :actioning_site, class: :Site
end

View file

@ -130,7 +130,7 @@ class Site < Sequel::Model
DISPOSABLE_EMAIL_BLACKLIST_PATH = File.join(DIR_ROOT, 'files', 'disposable_email_blacklist.conf')
BANNED_EMAIL_BLACKLIST_PATH = File.join(DIR_ROOT, 'files', 'banned_email_blacklist.conf')
BLOCK_JERK_THRESHOLD = 2
BLOCK_JERK_THRESHOLD = 4
MAXIMUM_TAGS = 5
MAX_USERNAME_LENGTH = 32.freeze
@ -572,6 +572,7 @@ class Site < Sequel::Model
def block!(site)
block = blockings_dataset.filter(site_id: site.id).first
return true if block
add_blocking site: site
end