fix: edit transfer need change fork info

This commit is contained in:
yystopf 2022-01-25 14:26:11 +08:00
parent 1e9a32a93e
commit 26f87fba16
1 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,7 @@ class Projects::TransferService < ApplicationService
update_owner
update_repo_url
update_visit_teams
update_fork_info
end
Rails.logger.info("##### Project transfer_service end ######")
@ -40,6 +41,11 @@ class Projects::TransferService < ApplicationService
end
end
def update_fork_info
fork_user = ForkUser.find_by(user_id: @owner.id, fork_project_id: @project.id)
fork_user.update(user_id: @new_owner.id) if fork_user.present?
end
def gitea_update_owner
begin
@gitea_repo = Gitea::Repository::TransferService.call(owner&.gitea_token, owner&.login, project.identifier, new_owner&.login)