From 118edbf61f3bd4e43d6d340bbe0b44bec4bf4d03 Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 22 Aug 2024 14:53:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9A=E7=A6=85=E9=81=93?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=95=B0=E6=8D=AE=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/import_issues_from_chandao.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/import_issues_from_chandao.rake b/lib/tasks/import_issues_from_chandao.rake index 41bbc3356..fd4c74ca1 100644 --- a/lib/tasks/import_issues_from_chandao.rake +++ b/lib/tasks/import_issues_from_chandao.rake @@ -9,7 +9,7 @@ namespace :import_from_chandao do CSV.foreach("#{Rails.root}/#{args.name}", headers: true) do | row | randd_field_hash = row.to_hash issue = Issue.new(issue_classify: "issue") - author = User.like(randd_field_hash['由谁创建']).take + author = User.like(randd_field_hash['由谁创建']).take || User.where(admin: first).first issue.author_id = author&.id assigner = randd_field_hash['指派给'].present? ? User.like(randd_field_hash['指派给']).take : nil if assigner.present?