We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 279de9a commit ac64c88Copy full SHA for ac64c88
1 file changed
odml/section.py
@@ -98,6 +98,13 @@ def name(self):
98
99
@name.setter
100
def name(self, new_value):
101
+ if self.name == new_value:
102
+ return
103
+
104
+ curr_parent = self.parent
105
+ if hasattr(curr_parent, "sections") and new_value in curr_parent.sections:
106
+ raise KeyError("Object with the same name already exists!")
107
108
self._name = new_value
109
110
@property
0 commit comments