summaryrefslogtreecommitdiff
path: root/app/services/projects/transfer_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/projects/transfer_service.rb')
-rw-r--r--app/services/projects/transfer_service.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/app/services/projects/transfer_service.rb b/app/services/projects/transfer_service.rb
index 17da77fe950..51c0989ee55 100644
--- a/app/services/projects/transfer_service.rb
+++ b/app/services/projects/transfer_service.rb
@@ -2,11 +2,11 @@
# Projects::TransferService class
#
-# Used for transfer project to another namespace
+# Used to transfer a project to another namespace
#
# Ex.
-# # Move projects to namespace with ID 17 by user
-# Projects::TransferService.new(project, user, namespace_id: 17).execute
+# # Move project to namespace by user
+# Projects::TransferService.new(project, user).execute(namespace)
#
module Projects
class TransferService < BaseService
@@ -103,6 +103,8 @@ module Projects
update_repository_configuration(@new_path)
+ remove_issue_contacts
+
execute_system_hooks
end
@@ -254,6 +256,12 @@ module Projects
namespace_traversal_ids: new_namespace.traversal_ids
}
end
+
+ def remove_issue_contacts
+ return unless @old_group&.root_ancestor != @new_namespace&.root_ancestor
+
+ CustomerRelations::IssueContact.delete_for_project(project.id)
+ end
end
end