mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
FIX: Ignore posts needing approval when calculating reviewable counts. (#13464)
In #12841, we started setting the ReviewableQueuedPost's target and topic after approving it instead of storing them in the payload. As a result, the reviewable_counts query started to include queued posts. When a category is set to require approval, every post has an associated reviewable. Pointing that each post has an associated queued post is not necessary in this case, so I added a WHERE clause to skip them.
This commit is contained in:
@ -509,7 +509,8 @@ class TopicView
|
||||
reviewable_scores s ON reviewable_id = r.id
|
||||
WHERE
|
||||
r.target_id IN (:post_ids) AND
|
||||
r.target_type = 'Post'
|
||||
r.target_type = 'Post' AND
|
||||
COALESCE(s.reason, '') != 'category'
|
||||
GROUP BY
|
||||
target_id
|
||||
SQL
|
||||
|
Reference in New Issue
Block a user