mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-17 00:24:26 -04:00
fix: Avoid creating empty tag on migration
This commit is contained in:
parent
62f3d648d4
commit
b9e5b781a7
1 changed files with 3 additions and 3 deletions
|
@ -23,9 +23,9 @@ def forwards_func(apps, schema_editor):
|
||||||
tag_set = (
|
tag_set = (
|
||||||
set(tag.strip() for tag in (snapshot.tags_old or '').split(','))
|
set(tag.strip() for tag in (snapshot.tags_old or '').split(','))
|
||||||
)
|
)
|
||||||
tag_list = list(tag_set) or []
|
tag_set.discard("")
|
||||||
|
|
||||||
for tag in tag_list:
|
for tag in tag_set:
|
||||||
new_tag, created = TagModel.objects.get_or_create(name=tag, slug=slugify(tag))
|
new_tag, created = TagModel.objects.get_or_create(name=tag, slug=slugify(tag))
|
||||||
TaggedItemModel.objects.get_or_create(
|
TaggedItemModel.objects.get_or_create(
|
||||||
content_type_id=ct[0].id,
|
content_type_id=ct[0].id,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue