Fix #4587: "Max 5 flags per 3 days" should account for reapproved flags.
This commit is contained in:
@@ -25,6 +25,7 @@ class PostFlag < ApplicationRecord
|
||||
scope :by_system, -> { where(creator: User.system) }
|
||||
scope :in_cooldown, -> { by_users.where("created_at >= ?", Danbooru.config.moderation_period.ago) }
|
||||
scope :expired, -> { pending.where("post_flags.created_at < ?", Danbooru.config.moderation_period.ago) }
|
||||
scope :active, -> { pending.or(rejected.in_cooldown) }
|
||||
|
||||
module SearchMethods
|
||||
def creator_matches(creator, searcher)
|
||||
|
||||
@@ -356,7 +356,7 @@ class User < ApplicationRecord
|
||||
|
||||
def is_flag_limited?
|
||||
return false if has_unlimited_flags?
|
||||
post_flags.pending.count >= 5
|
||||
post_flags.active.count >= 5
|
||||
end
|
||||
|
||||
# Flags are unlimited if you're an approver or you have at least 30 flags
|
||||
|
||||
Reference in New Issue
Block a user