修复:转移后仓库无法正确新建处理

This commit is contained in:
yystopf 2025-09-12 11:58:07 +08:00
parent e89a93e8ca
commit 5dfc0e74a8
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ class Repositories::CreateService < ApplicationService
begin
@gitea_repository = $gitea_client.get_repos_by_owner_repo(project.owner.login, params[:identifier])
rescue Gitea::Api::ServerError => e
if e.http_code.to_i == 404
if e.http_code.to_i == 404 || e.http_code.to_i == 307
if project.owner.is_a?(User)
# @gitea_repository = Gitea::Repository::CreateService.new(user.gitea_token, gitea_repository_params).call
@gitea_repository = $gitea_client.post_user_repos({query: {token: user.gitea_token}, body: gitea_repository_params.to_json})