diff options
author | Rémy Coutable <remy@rymai.me> | 2016-12-19 21:03:06 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-12-19 21:03:06 +0300 |
commit | 8c8c4f8c5a5f5845b9ebca415aaa29278cb904c7 (patch) | |
tree | 04eac1446c4ba989d395787e0a5edddd2368cfaa /app/models/merge_request.rb | |
parent | 696aa2aee32f69d8c5a7352f03bae3dda2e660ba (diff) | |
parent | 0631c7bcdce5dcb2aac94b1b755e63022a62469f (diff) |
Merge branch 'fix/import-export-mr-error' into 'master'
Fix import/export merge requests error
When MWBS is set and the MR exported/imported an error gets thrown. We should ignore this so it can succeed as the merge user may no longer exist in the target instance.
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/24009 and https://gitlab.com/gitlab-com/support-forum/issues/1345
See merge request !8134
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r-- | app/models/merge_request.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index b7c775777c7..5ce20cc43d6 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -97,7 +97,7 @@ class MergeRequest < ActiveRecord::Base validates :source_branch, presence: true validates :target_project, presence: true validates :target_branch, presence: true - validates :merge_user, presence: true, if: :merge_when_build_succeeds? + validates :merge_user, presence: true, if: :merge_when_build_succeeds?, unless: :importing? validate :validate_branches, unless: [:allow_broken, :importing?, :closed_without_fork?] validate :validate_fork, unless: :closed_without_fork? |