diff options
-rw-r--r-- | tagit/actions/tagging.py | 6 |
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: |