瀏覽代碼

fix migration creating conflicting tags based on slug

Nick Sweeting 4 年之前
父節點
當前提交
aa84a7ff2b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      archivebox/core/migrations/0006_auto_20201012_1520.py

+ 1 - 1
archivebox/core/migrations/0006_auto_20201012_1520.py

@@ -17,7 +17,7 @@ def forwards_func(apps, schema_editor):
         tag_set.discard("")
 
         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)