Skip to content
Snippets Groups Projects

model: Fix Referable.id_short property: Update parent Namespace on change

Merged Michael Thies requested to merge fix/id_short_namespace_update into master
2 files
+ 10
1
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 7
1
@@ -474,7 +474,13 @@ class Referable(metaclass=abc.ABCMeta):
if id_short in set_:
raise KeyError("Referable with id_short '{}' is already present in the parent Namespace"
.format(id_short))
for set_ in self.parent.namespace_element_sets:
if self in set_:
set_.discard(self)
self._id_short = id_short
set_.add(self)
break
# Redundant to the line above. However this way, we make sure that we really update the _id_short
self._id_short = id_short
def update(self,
Loading