diff --git a/lib/check_search.rb b/lib/check_search.rb index a3e53119f1..33de85cda6 100644 --- a/lib/check_search.rb +++ b/lib/check_search.rb @@ -351,6 +351,10 @@ def adjust_project_filter # Invalidate the search if empty... otherwise, adjust the projects filter @options['projects'] = project_ids.empty? ? [0] : project_ids end + if Team.current && !feed_query? && [@options['team_id']].flatten.size == 1 + t = Team.find([@options['team_id']].flatten.first) + @options['projects'] = @options['projects'].blank? ? (Project.where(team_id: t.id).map(&:id) + [nil]) : Project.where(id: @options['projects'], team_id: t.id).map(&:id) + end @options['projects'] += [nil] if @options['none_project'] end