Commit 0a80cc66 authored by Antoine Millet's avatar Antoine Millet
Browse files

Now raise an exception when registering an object with an already used id

parent 49799733
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -266,6 +266,8 @@ class TqlDatabase(object):
        """
        if obj.id not in self._objects:
            self._objects[obj.id] = obj
        else:
            raise TqlDatabaseError('An object is already registered with this id')

    def unregister(self, obj):
        """ Unregister an object from the database.