Fix users finder in MRs & Commits list - support query blocked users
Issue: #368339 (closed)
What does this MR do and why and how?
Fix these two bugs:
- Search for blocked user in MR list page, it cannot be searched
- Search for blocked user in Commits list page, it cannot be searched
What has changed in the sql query?
Raw SQL
SELECT
"users".*
FROM
"users"
INNER JOIN "project_authorizations" ON "users"."id" = "project_authorizations"."user_id"
WHERE
"project_authorizations"."project_id" = 6
AND "users"."state" IN ('active', 'blocked')
AND (
"users"."user_type" IS NULL
OR "users"."user_type" IN (6, 4)
)
ORDER BY
"users"."name" ASC
LIMIT
20
(This SQL is triggered at Autocomplete::UsersFinder#limited_users
)
Screenshots
Before | After |
---|---|
MRs page: only return active users
|
MRs page: return active and blocked users
|
Commmts page: only return active users
|
Commmts page: return active and blocked users
|
Edited by Zhiyuan Lu