Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-16 09:08:47 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-16 09:08:47 +0300
commita9a25b9e726c45bed9146661825e9b849f79d6a9 (patch)
tree477e8cb78deafd527148767390ea2259b6019ae4 /app
parent116d94a175ee96732bc831df18a6c6137f32c125 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/finders/ci/pipelines_finder.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/finders/ci/pipelines_finder.rb b/app/finders/ci/pipelines_finder.rb
index af7b23278a4..d9fe5c23a7e 100644
--- a/app/finders/ci/pipelines_finder.rb
+++ b/app/finders/ci/pipelines_finder.rb
@@ -119,11 +119,12 @@ module Ci
# rubocop: disable CodeReuse/ActiveRecord
def by_username(items)
- if params[:username].present?
- items.joins(:user).where(users: { username: params[:username] })
- else
- items
- end
+ return items unless params[:username].present?
+
+ user_id = User.by_username(params[:username]).pluck_primary_key.first
+ return Ci::Pipeline.none unless user_id
+
+ items.where(user_id: user_id)
end
# rubocop: enable CodeReuse/ActiveRecord