X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_common%2Fdbmemory.py;h=6f7e4c440ded2c8294ab0710e606a31ccce91780;hb=a4eaefe74757ccbd7ac513b72f21a3bf8bf391cb;hp=c27f846ca7065d191e76faa4d67eebb1a19abd85;hpb=3054f783ac759b221233fd0a82424aa105e4ea2e;p=osm%2Fcommon.git diff --git a/osm_common/dbmemory.py b/osm_common/dbmemory.py index c27f846..6f7e4c4 100644 --- a/osm_common/dbmemory.py +++ b/osm_common/dbmemory.py @@ -64,7 +64,7 @@ class DbMemory(DbBase): for i, _ in self._find(table, self._format_filter(filter)): id_list.append(i) deleted = len(id_list) - for i in id_list: + for i in reversed(id_list): del self.db[table][i] return {"deleted": deleted} except DbException: @@ -94,7 +94,7 @@ class DbMemory(DbBase): raise DbException("Not found entry with filter='{}'".format(filter), HTTPStatus.NOT_FOUND) return None self.db[table][i] = deepcopy(indata) - return {"upadted": 1} + return {"updated": 1} except Exception as e: # TODO refine raise DbException(str(e))