DEV: Add plugin modifier locations for user search locations (#23169)

This commit is contained in:
Mark VanLandingham 2023-08-21 12:23:42 -05:00 committed by GitHub
parent f179eef6ae
commit 730f652255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -198,7 +198,8 @@ class UserSearch
def search
ids = search_ids
return User.where("0=1") if ids.empty?
ids = DiscoursePluginRegistry.apply_modifier(:user_search_ids, ids)
return User.none if ids.empty?
results =
User.joins(

View File

@ -939,6 +939,8 @@ class Search
users = users.where(suspended_at: nil)
end
users = DiscoursePluginRegistry.apply_modifier(:search_user_search, users)
users_custom_data_query =
DB.query(<<~SQL, user_ids: users.pluck(:id), term: "%#{@original_term.downcase}%")
SELECT user_custom_fields.user_id, user_fields.name, user_custom_fields.value FROM user_custom_fields