From a8ea2c18959c700913132d8a2d7ce3a211303c10 Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Thu, 14 Apr 2016 11:34:42 -0300 Subject: Change transfer service to use existing methods --- app/services/projects/transfer_service.rb | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'app/services/projects/transfer_service.rb') diff --git a/app/services/projects/transfer_service.rb b/app/services/projects/transfer_service.rb index 0d8f8c6fbee..79a27f4af7e 100644 --- a/app/services/projects/transfer_service.rb +++ b/app/services/projects/transfer_service.rb @@ -35,11 +35,9 @@ module Projects end # Apply new namespace id and visibility level - project.tap do |p| - p.namespace = new_namespace - setup_visibility_level(p, new_namespace) - p.save! - end + project.namespace = new_namespace + project.visibility_level = new_namespace.visibility_level unless project.visibility_level_allowed_by_group? + project.save! # Notifications project.send_move_instructions(old_path) @@ -71,15 +69,5 @@ module Projects namespace.id != project.namespace_id && current_user.can?(:create_projects, namespace) end - - private - - def setup_visibility_level(project, new_namespace) - return unless new_namespace.is_a?(Group) - - if project.visibility_level > new_namespace.visibility_level - project.visibility_level = new_namespace.visibility_level - end - end end end -- cgit v1.2.1