mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 14:44:29 -04:00
remove emptystring tags before saving
This commit is contained in:
parent
f1823381d0
commit
9918bddb7e
1 changed files with 2 additions and 1 deletions
|
@ -201,7 +201,8 @@ class Snapshot(models.Model):
|
|||
def save_tags(self, tags=()):
|
||||
tags_id = []
|
||||
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.add(*tags_id)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue