From de2e90b3cb3598c2a992992ce197a04a0c8de916 Mon Sep 17 00:00:00 2001 From: Marcus Ottosson Date: Tue, 11 Aug 2015 13:27:03 +0100 Subject: [PATCH] Fixing #219 --- pyblish/plugin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyblish/plugin.py b/pyblish/plugin.py index 001d7713..cd0400ac 100644 --- a/pyblish/plugin.py +++ b/pyblish/plugin.py @@ -573,12 +573,15 @@ def __init__(self, *args, **kwargs): self._children = dict() def add(self, other): - super(Context, self).add(other) + if other in self: + raise ValueError("\"%s\" already in Context" % other) + self._children[other.id] = other + super(Context, self).add(other) def remove(self, other): - super(Context, self).remove(other) self._children.pop(other.id) + super(Context, self).remove(other) def create_instance(self, name, **kwargs): """Convenience method of the following.