diff options
author | Akos Gyimesi <akos@gyim.hu> | 2018-01-13 12:06:03 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-12-06 17:20:08 +0000 |
commit | 5fd5dad492a2918c10633996bb29d656a4e9137a (patch) | |
tree | 95f07d6d53289920cd9c24771d6cb9e7318fce8d /app/controllers/projects | |
parent | 2e3cefa6cdeabe9bfd169df9ed280895deb57be3 (diff) | |
download | gitlab-ce-5fd5dad492a2918c10633996bb29d656a4e9137a.tar.gz |
Improve error message when attempting to reopen MR and there's a new open MR for the same branch
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index d521db79f85..9781d159540 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -122,6 +122,10 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo respond_to do |format| format.html do + if merge_request_params[:state_event] && @merge_request.errors.any? + flash[:alert] = @merge_request.errors.values.flatten.to_sentence + end + if @merge_request.valid? redirect_to([@merge_request.target_project.namespace.becomes(Namespace), @merge_request.target_project, @merge_request]) else |