flags: remove uploader targeting restrictions.

Remove restrictions against flagging too many posts by the same
uploader. This had problems with preventing legitimate flags in some
cases, particularly with old legacy content. This will be policed
manually instead.
This commit is contained in:
evazion
2020-01-13 12:39:16 -06:00
parent 34c3df78d9
commit 0b08f38b8b
3 changed files with 0 additions and 71 deletions

View File

@@ -8,7 +8,6 @@ class PostFlag < ApplicationRecord
end
COOLDOWN_PERIOD = 3.days
CREATION_THRESHOLD = 10 # in 30 days
belongs_to_creator :class_name => "User"
belongs_to :post
@@ -125,14 +124,6 @@ class PostFlag < ApplicationRecord
def validate_creator_is_not_limited
return if is_deletion
if creator_id != User.system.id && creator.post_flags.where("created_at > ?", 30.days.ago).count >= CREATION_THRESHOLD
report = Reports::PostFlags.new(user_id: post.uploader_id, date_range: 90.days.ago)
if report.attackers.include?(creator_id)
errors[:creator] << "cannot flag posts uploaded by this user"
end
end
if CurrentUser.can_approve_posts?
# do nothing
elsif creator.created_at > 1.week.ago