From ce31875c190d1b6a57a250d20411759e26f80d23 Mon Sep 17 00:00:00 2001 From: victor <121183489011@qq.com> Date: Mon, 1 Feb 2021 15:17:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E9=98=B6=E6=AE=B5=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=A8=A1=E6=9D=BF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ci/templates_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/ci/templates_controller.rb b/app/controllers/ci/templates_controller.rb index 22998333..cb49590d 100644 --- a/app/controllers/ci/templates_controller.rb +++ b/app/controllers/ci/templates_controller.rb @@ -79,7 +79,6 @@ class Ci::TemplatesController < Ci::BaseController #======流水线模板查询=====# def templates_by_stage stage_type = params[:stage_type] - pipeline_id = params[:id] if stage_type != Ci::PipelineStage::CUSTOMIZE_STAGE_TYPE @templates = Ci::Template.where("stage_type = ?", stage_type) @templates = @templates.select{ |template| template.login == current_user.login || template.login == 'admin'} unless current_user.admin? @@ -87,7 +86,7 @@ class Ci::TemplatesController < Ci::BaseController @templates.each do |template| content = template.content unless content.blank? - pipeline = Ci::Pipeline.find(pipeline_id) + pipeline = Ci::Pipeline.find(params[:id]) template.content = content.gsub(/{name}/, pipeline.pipeline_name) unless pipeline.nil? end end