Merge branch 'develop' into standalone_develop

This commit is contained in:
yystopf 2022-01-25 14:26:20 +08:00
commit 3ce9b2d145
1 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,7 @@ class Projects::TransferService < ApplicationService
update_owner update_owner
update_repo_url update_repo_url
update_visit_teams update_visit_teams
update_fork_info
end end
Rails.logger.info("##### Project transfer_service end ######") Rails.logger.info("##### Project transfer_service end ######")
@ -40,6 +41,11 @@ class Projects::TransferService < ApplicationService
end end
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 def gitea_update_owner
begin begin
@gitea_repo = Gitea::Repository::TransferService.call(owner&.gitea_token, owner&.login, project.identifier, new_owner&.login) @gitea_repo = Gitea::Repository::TransferService.call(owner&.gitea_token, owner&.login, project.identifier, new_owner&.login)