aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Baumgartner <dev@igsor.net>2023-03-04 14:16:56 +0100
committerMatthias Baumgartner <dev@igsor.net>2023-03-04 14:16:56 +0100
commita4be2d7d5752ed68a5c0f5fa46a1058f17b9ca01 (patch)
treeb289b466301303421911bf3fcdcdea70b83d7d61
parent141cfeade2750e0255ca010079421efce4abeca2 (diff)
downloadtagit-a4be2d7d5752ed68a5c0f5fa46a1058f17b9ca01.tar.gz
tagit-a4be2d7d5752ed68a5c0f5fa46a1058f17b9ca01.tar.bz2
tagit-a4be2d7d5752ed68a5c0f5fa46a1058f17b9ca01.zip
empty tag set bugfix
-rw-r--r--tagit/actions/tagging.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tagit/actions/tagging.py b/tagit/actions/tagging.py
index 90e5931..ab25cb8 100644
--- a/tagit/actions/tagging.py
+++ b/tagit/actions/tagging.py
@@ -79,7 +79,7 @@ class AddTag(Action):
# get objects
ents = browser.unfold(browser.selection)
# collect tags
- tags = reduce(operator.add, tags) # FIXME: mb/port: pass set once supported by Nodes.set
+ tags = reduce(operator.add, tags, self.root.session.storage.empty(ns.bsn.Tag)) # FIXME: mb/port: pass set once supported by Nodes.set
# set tags
ents.set(ns.bse.tag, tags)
session.dispatch('on_predicate_modified', ns.bse.tag, ents, tags)
@@ -130,7 +130,7 @@ class EditTag(Action):
added_labels = labels - original_labels
# get tags of removed labels
removed = {tag for tag, lbl in tags.items() if lbl in removed_labels}
- removed = reduce(operator.add, removed)
+ removed = reduce(operator.add, removed, self.root.session.storage.empty(ns.bsn.Tag))
# get tags of added labels
# FIXME: deny adding tags if tag vocabulary is fixed (ontology case)
lut = {label: tag for tag, label in tags.items()}
@@ -142,7 +142,7 @@ class EditTag(Action):
getattr(TAG_PREFIX, urllib.parse.quote(lbl)))
tag.set(ns.bst.label, lbl)
added.add(tag)
- added = reduce(operator.add, added)
+ added = reduce(operator.add, added, self.root.session.storage.empty(ns.bsn.Tag))
# apply differences
with self.root.browser as browser, \
self.root.session as session: