mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Address review comments for 5ed84d9885.
This commit is contained in:
@@ -533,7 +533,7 @@ class TopicQuery
|
||||
if type == :group
|
||||
result = result
|
||||
.includes(:allowed_users)
|
||||
.joins("INNER JOIN topic_allowed_groups tag ON tag.topic_id = topics.id AND tag.group_id IN (SELECT id FROM groups WHERE name ilike '#{sanitize_sql_array([@options[:group_name]])}')")
|
||||
.joins("INNER JOIN topic_allowed_groups tag ON tag.topic_id = topics.id AND tag.group_id IN (SELECT id FROM groups WHERE LOWER(name) = '#{PG::Connection.escape_string(@options[:group_name].downcase)}')")
|
||||
|
||||
unless user.admin?
|
||||
result = result.joins("INNER JOIN group_users gu ON gu.group_id = tag.group_id AND gu.user_id = #{user.id.to_i}")
|
||||
|
||||
Reference in New Issue
Block a user