Merge branch 'develop' of https://gitlink.org.cn/Trustie/forgeplus into develop
This commit is contained in:
commit
d44308fc82
|
@ -17,7 +17,7 @@
|
|||
|
||||
class ForkUser < ApplicationRecord
|
||||
belongs_to :project
|
||||
belongs_to :user
|
||||
belongs_to :owner
|
||||
belongs_to :fork_project, class_name: 'Project', foreign_key: :fork_project_id
|
||||
|
||||
after_create :incre_project_common, :incre_user_statistic, :incre_platform_statistic
|
||||
|
|
|
@ -157,7 +157,7 @@ class PullRequests::CreateService < ApplicationService
|
|||
raise "head参数不能为空" if @params[:head].blank?
|
||||
raise "base参数不能为空" if @params[:base].blank?
|
||||
raise "fork_project_id参数错误" if is_original && !@project.forked_projects.pluck(:id).include?(@params[:fork_project_id].to_i)
|
||||
raise "merge_user_login参数错误" if is_original && @project.fork_users.joins(:user).where(users: {login: @params[:merge_user_login]}).blank?
|
||||
raise "merge_user_login参数错误" if is_original && @project.fork_users.joins(:owner).where(users: {login: @params[:merge_user_login]}).blank?
|
||||
raise "分支内容相同,无需创建合并请求" if @params[:head] === @params[:base] && !is_original
|
||||
raise "合并请求已存在" if @project&.pull_requests.where(head: @params[:head], base: @params[:base], status: 0, is_original: is_original, fork_project_id: @params[:fork_project_id]).present?
|
||||
raise @pull_issue.errors.full_messages.join(", ") unless pull_issue.valid?
|
||||
|
|
Loading…
Reference in New Issue