summaryrefslogtreecommitdiff
path: root/app/services/projects
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-07-02 14:31:25 +0200
committerRobert Speicher <rspeicher@gmail.com>2015-07-11 16:47:33 -0400
commitb93053695a94822801a87ff2b1850999130842c1 (patch)
treef0dce4af945bf2c8cdfbb86bb34df92171a01ea2 /app/services/projects
parentf94587eccbeda3bd0092588a12ddf9a586b29dce (diff)
downloadgitlab-ce-b93053695a94822801a87ff2b1850999130842c1.tar.gz
Fix transferring of project to another group using the API.
Diffstat (limited to 'app/services/projects')
-rw-r--r--app/services/projects/transfer_service.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/app/services/projects/transfer_service.rb b/app/services/projects/transfer_service.rb
index 489e03bd5ef..f43c0ef70e9 100644
--- a/app/services/projects/transfer_service.rb
+++ b/app/services/projects/transfer_service.rb
@@ -11,19 +11,16 @@ module Projects
include Gitlab::ShellAdapter
class TransferError < StandardError; end
- def execute
- namespace_id = params[:new_namespace_id]
- namespace = Namespace.find_by(id: namespace_id)
-
- if allowed_transfer?(current_user, project, namespace)
- transfer(project, namespace)
+ def execute(new_namespace)
+ if allowed_transfer?(current_user, project, new_namespace)
+ transfer(project, new_namespace)
else
- project.errors.add(:namespace, 'is invalid')
+ project.errors.add(:new_namespace, 'is invalid')
false
end
rescue Projects::TransferService::TransferError => ex
project.reload
- project.errors.add(:namespace_id, ex.message)
+ project.errors.add(:new_namespace, ex.message)
false
end