summaryrefslogtreecommitdiff
path: root/lib/api/internal.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-02-07 09:21:17 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-02-07 09:21:17 +0100
commit2cce501f452e84d9fe8c27bd0291e4984c12bc4c (patch)
tree5b98215be26330c0db4b39e2f5f39720f0c63f2c /lib/api/internal.rb
parentadb6dd067037a3df1951b5dacae37a06541ec286 (diff)
parent4457cf9d178dc9912fd9c16427ad81b389179d00 (diff)
downloadgitlab-ce-2cce501f452e84d9fe8c27bd0291e4984c12bc4c.tar.gz
Merge commit '4457cf9d178dc9912fd9c16427ad81b389179d00' into fix/gb/fix-redundant-pipeline-stagesfix/gb/fix-redundant-pipeline-stages
* commit '4457cf9d178dc9912fd9c16427ad81b389179d00': (76 commits) Conflicts: spec/services/ci/retry_build_service_spec.rb
Diffstat (limited to 'lib/api/internal.rb')
-rw-r--r--lib/api/internal.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb
index 063f0d6599c..9285fb90cdc 100644
--- a/lib/api/internal.rb
+++ b/lib/api/internal.rb
@@ -42,11 +42,14 @@ module API
end
access_checker_klass = wiki? ? Gitlab::GitAccessWiki : Gitlab::GitAccess
- access_checker = access_checker_klass
- .new(actor, project, protocol, authentication_abilities: ssh_authentication_abilities, redirected_path: redirected_path)
+ access_checker = access_checker_klass.new(actor, project,
+ protocol, authentication_abilities: ssh_authentication_abilities,
+ namespace_path: namespace_path, project_path: project_path,
+ redirected_path: redirected_path)
begin
access_checker.check(params[:action], params[:changes])
+ @project ||= access_checker.project
rescue Gitlab::GitAccess::UnauthorizedError, Gitlab::GitAccess::NotFoundError => e
return { status: false, message: e.message }
end
@@ -207,8 +210,11 @@ module API
# A user is not guaranteed to be returned; an orphaned write deploy
# key could be used
if user
- redirect_message = Gitlab::Checks::ProjectMoved.fetch_redirect_message(user.id, project.id)
+ redirect_message = Gitlab::Checks::ProjectMoved.fetch_message(user.id, project.id)
+ project_created_message = Gitlab::Checks::ProjectCreated.fetch_message(user.id, project.id)
+
output[:redirected_message] = redirect_message if redirect_message
+ output[:project_created_message] = project_created_message if project_created_message
end
output