Commit a8ea2c18 authored by Felipe Artur's avatar Felipe Artur

Change transfer service to use existing methods

parent 6b3a5384
...@@ -35,11 +35,9 @@ module Projects ...@@ -35,11 +35,9 @@ module Projects
end end
# Apply new namespace id and visibility level # Apply new namespace id and visibility level
project.tap do |p| project.namespace = new_namespace
p.namespace = new_namespace project.visibility_level = new_namespace.visibility_level unless project.visibility_level_allowed_by_group?
setup_visibility_level(p, new_namespace) project.save!
p.save!
end
# Notifications # Notifications
project.send_move_instructions(old_path) project.send_move_instructions(old_path)
...@@ -71,15 +69,5 @@ module Projects ...@@ -71,15 +69,5 @@ module Projects
namespace.id != project.namespace_id && namespace.id != project.namespace_id &&
current_user.can?(:create_projects, namespace) current_user.can?(:create_projects, namespace)
end 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
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment