From 9b5defec6dccd3d74195ab9a19e4451a9a60c4b9 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Sat, 20 Jun 2026 12:10:13 +0200 Subject: [PATCH] # HOTFIX * fixes bug where unfetchable data entries of a GeometryConflict would result in an error via API --- api/utils/serializer/serializer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/utils/serializer/serializer.py b/api/utils/serializer/serializer.py index f952df73..d9b19d72 100644 --- a/api/utils/serializer/serializer.py +++ b/api/utils/serializer/serializer.py @@ -217,7 +217,11 @@ class AbstractModelAPISerializer: conflict_geometries = geometry.get_conflict_geometries() for geom in conflict_geometries: try: - data = geom.get_data_objects(["identifier", "id"])[0] + data = geom.get_data_objects(["identifier", "id"]) + if len(data) == 0: + # expected behaviour in case of deleted data object + continue + data = data[0] except KeyError: raise AssertionError(f"Geometry {geom.id} is not attached to any entries. Contact an admin!") ids.append(