diff options
author | Go MAEDA <maeda@farend.jp> | 2022-07-31 13:00:25 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2022-07-31 13:00:25 +0000 |
commit | 6ee209843ed0720a861173680bc888a10f305b2e (patch) | |
tree | 491f59155ed89af292049cc1695ce22133c35097 /app | |
parent | 6b8538929ec7aeb14d872261af29543660a4d4e9 (diff) | |
download | redmine-6ee209843ed0720a861173680bc888a10f305b2e.tar.gz redmine-6ee209843ed0720a861173680bc888a10f305b2e.zip |
Don't load changesets when IssuesController#show processes API requests without "include=changesets" (#37528).
Patch by Go MAEDA.
git-svn-id: https://svn.redmine.org/redmine/trunk@21746 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/issues_controller.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 056d309e9..5d67cd8cc 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -94,7 +94,7 @@ class IssuesController < ApplicationController def show @journals = @issue.visible_journals_with_index - @has_changesets = @issue.changesets.visible.preload(:repository, :user).exists? + @has_changesets = @issue.changesets.visible.preload(:repository, :user).exists? unless api_request? @relations = @issue.relations. select do |r| @@ -119,8 +119,10 @@ class IssuesController < ApplicationController end format.api do @allowed_statuses = @issue.new_statuses_allowed_to(User.current) - @changesets = @issue.changesets.visible.preload(:repository, :user).to_a - @changesets.reverse! if User.current.wants_comments_in_reverse_order? + if include_in_api_response?('changesets') + @changesets = @issue.changesets.visible.preload(:repository, :user).to_a + @changesets.reverse! if User.current.wants_comments_in_reverse_order? + end end format.atom do render :template => 'journals/index', :layout => false, |