diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2017-12-22 18:44:53 +0300 |
---|---|---|
committer | Jan Provaznik <jprovaznik@gitlab.com> | 2018-01-02 14:07:26 +0300 |
commit | 017c1297cdcfbb7431dbbc0445e29d1c95d934c0 (patch) | |
tree | e3cb16e2473cc744fd75907a53c924d23e0a8bca /lib/gitlab/search_results.rb | |
parent | 05292ba958c20ac560cdc43e90d954cb201eaf62 (diff) |
Skip projects filter on issues search
When searching for issues, an additional subquery
is added which filters only issues in a project. If global context is
used (no project is specified) this query filters all projects user has
access to.
In that case we can skip this filter because filtering only projects
user has access to is added anyway.
The filter is used only if a custom project context is specified
Related to #40540
Diffstat (limited to 'lib/gitlab/search_results.rb')
-rw-r--r-- | lib/gitlab/search_results.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/search_results.rb b/lib/gitlab/search_results.rb index 7037e2e61cc..ca48c6df602 100644 --- a/lib/gitlab/search_results.rb +++ b/lib/gitlab/search_results.rb @@ -82,7 +82,10 @@ module Gitlab end def issues - issues = IssuesFinder.new(current_user).execute.where(project_id: project_ids_relation) + issues = IssuesFinder.new(current_user).execute + unless default_project_filter + issues = issues.where(project_id: project_ids_relation) + end issues = if query =~ /#(\d+)\z/ |