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:
evazion
2022-09-22 22:31:33 -05:00
parent dff27e3a3a
commit e5edd79180
5 changed files with 14 additions and 29 deletions

View File

@@ -170,7 +170,7 @@ class PostQueryBuilder
when "approver"
relation.approver_matches(value)
when "flagger"
relation.flagger_matches(value, current_user)
relation.user_subquery_matches(PostFlag.unscoped.category_matches("normal"), value, current_user)
when "appealer"
relation.user_subquery_matches(PostAppeal.unscoped, value, current_user)
when "commenter", "comm"