diff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rb index 1668b4a6b..6917974b8 100644 --- a/app/controllers/journals_controller.rb +++ b/app/controllers/journals_controller.rb @@ -1,5 +1,5 @@ class JournalsController < ApplicationController - before_action :require_login, except: :index + before_action :require_login, except: [:index, :get_children_journals] before_action :set_issue before_action :check_issue_permission before_action :set_journal, only: [:destroy, :edit, :update] diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 6d0867a0c..f60351e84 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -207,8 +207,8 @@ class RepositoriesController < ApplicationController status_id: 1, priority_id: 1 } - pull_issue = Issue.new(issue_params) - if pull_issue.save! + @pull_issue = Issue.new(issue_params) + if @pull_issue.save! local_requests = PullRequest.new(local_params.merge(user_id: current_user.try(:id), project_id: @project.id, issue_id: pull_issue.id)) if local_requests.save gitea_request = Gitea::PullRequest::CreateService.new(current_user.try(:gitea_token), @project.owner, @project.try(:identifier), requests_params).call diff --git a/app/interactors/gitea/create_file_interactor.rb b/app/interactors/gitea/create_file_interactor.rb index 18e105f31..d8232379a 100644 --- a/app/interactors/gitea/create_file_interactor.rb +++ b/app/interactors/gitea/create_file_interactor.rb @@ -53,7 +53,7 @@ module Gitea def file_params file_params = {} - file_params = file_params.merge(branch: @params[:branch]) unless (@params[:branch].blank? || @params[:new_branch].present?) + file_params = file_params.merge(branch: @params[:branch]) unless @params[:branch].blank? file_params = file_params.merge(new_branch: @params[:new_branch]) unless @params[:new_branch].blank? file_params = file_params.merge(content: Base64.encode64(@params[:content])) file_params = file_params.merge(message: @params[:message]) unless @params[:message].blank? diff --git a/app/views/repositories/create_file.json.jbuilder b/app/views/repositories/create_file.json.jbuilder index 3c842dcce..5687ee731 100644 --- a/app/views/repositories/create_file.json.jbuilder +++ b/app/views/repositories/create_file.json.jbuilder @@ -3,6 +3,7 @@ json.sha @file['content']['sha'] json.size @file['content']['size'] json.content @file['content']['content'] json.encoding @file['content']['encoding'] +json.pr_id @pull_issue.try(:id) json.commit do json.message @file['commit']['message'] json.author @file['commit']['author'] diff --git a/app/views/repositories/update_file.json.jbuilder b/app/views/repositories/update_file.json.jbuilder index 3c842dcce..5687ee731 100644 --- a/app/views/repositories/update_file.json.jbuilder +++ b/app/views/repositories/update_file.json.jbuilder @@ -3,6 +3,7 @@ json.sha @file['content']['sha'] json.size @file['content']['size'] json.content @file['content']['content'] json.encoding @file['content']['encoding'] +json.pr_id @pull_issue.try(:id) json.commit do json.message @file['commit']['message'] json.author @file['commit']['author'] diff --git a/dump.rdb b/dump.rdb index 3922ec36f..c4c30776b 100644 Binary files a/dump.rdb and b/dump.rdb differ