Commit 971b67ce authored by James Lopez's avatar James Lopez

Fix transfer project redirect loop

parent d5632b6b
...@@ -43,8 +43,8 @@ module Projects ...@@ -43,8 +43,8 @@ module Projects
@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 @@ module Projects ...@@ -118,6 +118,7 @@ module Projects
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