diff --git a/src/gui/views/treemodels/flatbasemodel.py b/src/gui/views/treemodels/flatbasemodel.py index 005a294b4..8a1f40a5f 100644 --- a/src/gui/views/treemodels/flatbasemodel.py +++ b/src/gui/views/treemodels/flatbasemodel.py @@ -303,6 +303,9 @@ class FlatNodeMap(object): :Returns: path of the row inserted in the treeview :Returns type: integer or None """ + if srtkey_hndl[1] in self._hndl2index: + raise ValueError, 'Attempt to add row twice to the model (%s)' % \ + srtkey_hndl[1] if not self._identical: bisect.insort_left(self._fullhndl, srtkey_hndl) if allkeyonly: diff --git a/src/gui/views/treemodels/treebasemodel.py b/src/gui/views/treemodels/treebasemodel.py index c077cb1e3..bb3377c3c 100644 --- a/src/gui/views/treemodels/treebasemodel.py +++ b/src/gui/views/treemodels/treebasemodel.py @@ -590,8 +590,8 @@ class TreeBaseModel(gtk.GenericTreeModel): Otherwise, a node should never be added twice! """ if not self.group_can_have_handle: - raise ValueError, 'attempt to add twice a node to the model %s' % \ - str(parent) + ' ' + str(child) + ' ' + sortkey + raise ValueError, 'Attempt to add node twice to the model (%s:%s)' \ + % (str(parent), str(child)) if handle: node.set_handle(handle) if not self._in_build: