Merge branch 'dev_trustie' of http://git.trustie.net/jasder/forgeplus into dev_trustie

This commit is contained in:
Jasder 2020-08-15 13:24:52 +08:00
commit a8522edaa9
1 changed files with 5 additions and 1 deletions

View File

@ -70,7 +70,11 @@ class PullRequestsController < ApplicationController
if local_requests.save
remote_pr_params = @local_params
remote_pr_params = remote_pr_params.merge(head: "#{params[:merge_user_login]}:#{params[:head]}").compact if local_requests.is_original && params[:merge_user_login]
gitea_request = Gitea::PullRequest::CreateService.call(current_user.try(:gitea_token), @project.owner, @repository.try(:identifier), remote_pr_params.except(:milestone))
if @project.forked_from_project_id.present?
gitea_request = Gitea::PullRequest::CreateService.call(current_user.try(:gitea_token), @project.fork_project.owner, @repository.try(:identifier), remote_pr_params.except(:milestone))
else
gitea_request = Gitea::PullRequest::CreateService.call(current_user.try(:gitea_token), @project.owner, @repository.try(:identifier), remote_pr_params.except(:milestone))
end
if gitea_request && local_requests.update_attributes(gpid: gitea_request["number"])
if params[:issue_tag_ids].present?
params[:issue_tag_ids].each do |tag|