Commit 7e0a2b3b authored by Jacob Vosmaer's avatar Jacob Vosmaer

Test if the label is valid before creating link

parent 0b3ebb64
......@@ -18,7 +18,7 @@ class MigrateTaggableLabels < ActiveRecord::Migration
label_name = tagging.tag.name
label = target.project.labels.find_or_create_by(title: label_name)
if LabelLink.create(label: label, target: target)
if label.valid? && LabelLink.create(label: label, target: target)
print '.'
else
print 'F'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment