diff options
author | Rémy Coutable <remy@rymai.me> | 2016-09-19 11:41:15 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-09-19 11:41:15 +0300 |
commit | 1e7ea64e6237f32173f429dfd490c39ccb6b4f7b (patch) | |
tree | 881a7400b53219162618d19c21ca40e0b85e277e /app | |
parent | 42754aab184ace4e81943cd21357d4390f4d2475 (diff) | |
parent | 63493944b829883e9601ff0a0f1ca3679c936674 (diff) |
Merge branch '22248-fix-namespace-undefined-method' into 'master'
Render invalid template for open merge requests without source project
If source project was removed and merge request for some reason wasn't closed is rendered `invalid` template. Fix !6177
Fix #22248
See merge request !6383
Diffstat (limited to 'app')
-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 aa8645ba8cc..0288ee87717 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -428,6 +428,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController end def validates_merge_request + # If source project was removed and merge request for some reason + # wasn't close (Ex. mr from fork to origin) + return invalid_mr if !@merge_request.source_project && @merge_request.open? + # Show git not found page # if there is no saved commits between source & target branch if @merge_request.commits.blank? |