mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-21 13:52:30 +02:00
remove emptystring tags before saving
This commit is contained in:
@@ -201,7 +201,8 @@ class Snapshot(models.Model):
|
|||||||
def save_tags(self, tags=()):
|
def save_tags(self, tags=()):
|
||||||
tags_id = []
|
tags_id = []
|
||||||
for tag in tags:
|
for tag in tags:
|
||||||
tags_id.append(Tag.objects.get_or_create(name=tag)[0].id)
|
if tag.strip():
|
||||||
|
tags_id.append(Tag.objects.get_or_create(name=tag)[0].id)
|
||||||
self.tags.clear()
|
self.tags.clear()
|
||||||
self.tags.add(*tags_id)
|
self.tags.add(*tags_id)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user