flags: fix flagger:<name> not returning self-flagged uploads
Fix the search `flagger:evazion user:evazion` not returning the user's own self-flagged uploads.
Followup to a6e0872ce.
Fixes #4690: user profile 'flags' count links to /post_flags with different search criteria
This commit is contained in:
@@ -31,18 +31,6 @@ class PostFlag < ApplicationRecord
|
||||
scope :active, -> { pending.or(rejected.in_cooldown) }
|
||||
|
||||
module SearchMethods
|
||||
def creator_matches(creator, searcher)
|
||||
return none if creator.nil?
|
||||
|
||||
policy = Pundit.policy!(searcher, PostFlag.unscoped.new(creator: creator))
|
||||
|
||||
if policy.can_view_flagger?
|
||||
where(creator: creator).where.not(post: searcher.posts)
|
||||
else
|
||||
none
|
||||
end
|
||||
end
|
||||
|
||||
def category_matches(category)
|
||||
case category
|
||||
when "normal"
|
||||
|
||||
Reference in New Issue
Block a user