diff --git a/app/controllers/api/v1/issues_controller.rb b/app/controllers/api/v1/issues_controller.rb index d61615e4a..d320dc1d7 100644 --- a/app/controllers/api/v1/issues_controller.rb +++ b/app/controllers/api/v1/issues_controller.rb @@ -34,6 +34,7 @@ class Api::V1::IssuesController < Api::V1::BaseController end def show + redirect_to api_v1_project_pull_request_path(@project.id, @issue.serial_id) if @issue.pull_request end def create diff --git a/app/controllers/api/v1/pull_requests_controller.rb b/app/controllers/api/v1/pull_requests_controller.rb index cfe6d984d..ab4b262d4 100644 --- a/app/controllers/api/v1/pull_requests_controller.rb +++ b/app/controllers/api/v1/pull_requests_controller.rb @@ -39,6 +39,7 @@ class Api::V1::PullRequestsController < Api::V1::BaseController end def show + redirect_to api_v1_project_issue_path(@project.id, @issue.serial_id) if @pull.nil? end def create diff --git a/app/controllers/projects/pull_requests_controller.rb b/app/controllers/projects/pull_requests_controller.rb index a7e374d1a..bd34682fb 100644 --- a/app/controllers/projects/pull_requests_controller.rb +++ b/app/controllers/projects/pull_requests_controller.rb @@ -79,7 +79,11 @@ class Projects::PullRequestsController < Projects::BaseController end def show - load_diff_commits_data + if @pull.nil? + redirect_to project_issue_path(@project, @issue) + else + load_diff_commits_data + end end def index(status = 200)