diff --git a/src/backend/models/model.py b/src/backend/models/model.py index 628329f2..9e1e01b6 100644 --- a/src/backend/models/model.py +++ b/src/backend/models/model.py @@ -96,9 +96,13 @@ class Model(MutableMapping): def __delitem__(self, key) -> None: with self._write_lock: - item = self._data.pop(key) + item = self._data[key] + item.parent_model = None + del self._data[key] + index = self._sorted_data.index(item) del self._sorted_data[index] + ModelItemDeleted(self.sync_id, index)