From 8ba1198b4ac8543d5c8b0b784165f8b8b533219c Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 14 Oct 2021 16:38:12 +0800 Subject: [PATCH 1/2] fix: pr files commits count --- app/views/pull_requests/show.json.jbuilder | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/pull_requests/show.json.jbuilder b/app/views/pull_requests/show.json.jbuilder index 5c30bd172..ee6563965 100644 --- a/app/views/pull_requests/show.json.jbuilder +++ b/app/views/pull_requests/show.json.jbuilder @@ -3,8 +3,8 @@ json.project_name @project.name json.identifier @project.identifier json.project_identifier @project.identifier json.pr_time time_from_now(@pull_request.updated_at) -json.commits_count @pull_request.commits_count -json.files_count @pull_request.files_count +json.commits_count @gitea_pull["commit_num"] +json.files_count @gitea_pull["changed_files"] json.comments_count @issue.journals.parent_journals.size json.comments_total_count @issue.get_journals_size From 3d8b19fa7379638ab5dff9fcb3929c3a1e11cbbc Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 14 Oct 2021 16:59:43 +0800 Subject: [PATCH 2/2] fix: edit pr fork project info --- app/controllers/pull_requests_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index fe04dd5e5..1a31704b2 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -69,9 +69,9 @@ class PullRequestsController < ApplicationController end def edit - @fork_project_user_name = @project&.fork_project&.owner.try(:show_real_name) - @fork_project_user = @project&.fork_project&.owner.try(:login) - @fork_project_identifier = @project&.fork_project&.repository.try(:identifier) + @fork_project_user_name = @pull_request&.fork_project&.owner.try(:show_real_name) + @fork_project_user = @pull_request&.fork_project&.owner.try(:login) + @fork_project_identifier = @pull_request&.fork_project&.repository.try(:identifier) end def update