1
0
Fork 0

fix migration creating conflicting tags based on slug

This commit is contained in:
Nick Sweeting 2021-02-01 05:13:23 -05:00
parent 4d21a04ab5
commit aa84a7ff2b

View file

@ -17,7 +17,7 @@ def forwards_func(apps, schema_editor):
tag_set.discard("") tag_set.discard("")
for tag in tag_set: for tag in tag_set:
to_add, _ = TagModel.objects.get_or_create(name=tag, slug=slugify(tag)) to_add, _ = TagModel.objects.get_or_create(name=tag, defaults={'slug': slugify(tag)})
snapshot.tags.add(to_add) snapshot.tags.add(to_add)