更改:nil判断
This commit is contained in:
parent
97685bf68c
commit
f1a79d926c
|
@ -162,19 +162,23 @@ class Api::Pm::IssuesController < Api::Pm::BaseController
|
||||||
issue.changer = changer
|
issue.changer = changer
|
||||||
issue.updated_on = row[5]
|
issue.updated_on = row[5]
|
||||||
issue.status_id = row[6].to_i
|
issue.status_id = row[6].to_i
|
||||||
row[7].split(',').each do |a|
|
if row[7].present?
|
||||||
u = User.find_by(login: a)
|
row[7].split(',').each do |a|
|
||||||
next unless u.present?
|
u = User.find_by(login: a)
|
||||||
issue.assigners << u
|
next unless u.present?
|
||||||
|
issue.assigners << u
|
||||||
|
end
|
||||||
end
|
end
|
||||||
issue.priority_id = row[8]
|
issue.priority_id = row[8]
|
||||||
row[9].split(',').each_slice(2).to_a.each do |t|
|
if row[9].present?
|
||||||
tag = IssueTag.find_by(project_id: 0, organization_id: params[:organization_id], name: t[0])
|
row[9].split(',').each_slice(2).to_a.each do |t|
|
||||||
if tag.present?
|
tag = IssueTag.find_by(project_id: 0, organization_id: params[:organization_id], name: t[0])
|
||||||
issue.issue_tags << tag
|
if tag.present?
|
||||||
else
|
issue.issue_tags << tag
|
||||||
tag = IssueTag.create(project_id: 0,organization_id: params[:organization_id], name: t[0], color: t[1])
|
else
|
||||||
issue.issue_tags << tag
|
tag = IssueTag.create(project_id: 0,organization_id: params[:organization_id], name: t[0], color: t[1])
|
||||||
|
issue.issue_tags << tag
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
issue.start_date = row[10]
|
issue.start_date = row[10]
|
||||||
|
|
Loading…
Reference in New Issue