summaryrefslogtreecommitdiff
path: root/lib/api/internal.rb
diff options
context:
space:
mode:
authorSimon Knox <psimyn@gmail.com>2018-02-07 20:05:38 +1100
committerSimon Knox <psimyn@gmail.com>2018-02-07 20:05:38 +1100
commit4e91d397833eb10e9eb64a48387c441be2922dfb (patch)
tree079cbe95e6b0ac773987dd2ccedb98b1ded9681b /lib/api/internal.rb
parentb68e473e7bb2b64e1a36c54f9ced10ffe5a96763 (diff)
parent4457cf9d178dc9912fd9c16427ad81b389179d00 (diff)
downloadgitlab-ce-snake-case.tar.gz
Merge branch 'master' into snake-casesnake-case
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