Commit 3859a036 authored by James Lopez's avatar James Lopez
Browse files

Fix transfer project redirect loop

parent 40a80e029610
...@@ -43,8 +43,8 @@ def transfer(project) ...@@ -43,8 +43,8 @@ def transfer(project)
@new_path = File.join(@new_namespace.try(:full_path) || '', project.path) @new_path = File.join(@new_namespace.try(:full_path) || '', project.path)
@old_namespace = project.namespace @old_namespace = project.namespace
if Project.where(path: project.path, namespace_id: @new_namespace.try(:id)).exists? if Project.where(namespace_id: @new_namespace.try(:id)).where('path = ? or name = ?', project.path, project.path).exists?
raise TransferError.new("Project with same path in target namespace already exists") raise TransferError.new("Project with same name or path in target namespace already exists")
end end
if project.has_container_registry_tags? if project.has_container_registry_tags?
...@@ -118,6 +118,7 @@ def refresh_permissions ...@@ -118,6 +118,7 @@ def refresh_permissions
def rollback_side_effects def rollback_side_effects
rollback_folder_move rollback_folder_move
project.reload
update_namespace_and_visibility(@old_namespace) update_namespace_and_visibility(@old_namespace)
write_repository_config(@old_path) write_repository_config(@old_path)
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