From 04a733d99f9366164b9ce7710edab3651b58c81d Mon Sep 17 00:00:00 2001 From: yystopf Date: Fri, 13 May 2022 16:57:41 +0800 Subject: [PATCH] fix: check user trace tasks count --- app/controllers/traces/projects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/traces/projects_controller.rb b/app/controllers/traces/projects_controller.rb index 15d7102eb..fee8fda9e 100644 --- a/app/controllers/traces/projects_controller.rb +++ b/app/controllers/traces/projects_controller.rb @@ -7,7 +7,7 @@ class Traces::ProjectsController < Traces::BaseController def tasks branch_name = params[:branch_name] - # return render_error("无可用检测次数") if @project&.trace_tasks_count >= 5 + return render_error("无可用检测次数") if @project.user_trace_tasks.size >= 5 return render_error("分支名不能为空!") if branch_name.blank? @all_branches = Gitea::Repository::Branches::ListNameService.call(@project&.owner, @project.identifier) return render_error("请输入正确的分支名!") unless @all_branches["branch_name"].include?(branch_name)