From ab534556a21a0f6bba1f2264802aab8e07d6cec3 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Thu, 29 Sep 2022 10:29:33 +0200 Subject: [PATCH] Fix geometry conflict message * fixes bug where geometry conflicts template message has been rendered despite having no active geometry conflict * happened in case of existing geometry conflicts related to an as deleted marked entry --- konova/models/object.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/konova/models/object.py b/konova/models/object.py index 8af95e18..015d34ef 100644 --- a/konova/models/object.py +++ b/konova/models/object.py @@ -698,18 +698,16 @@ class GeoReferencedMixin(models.Model): return request instance_objs = [] - add_message = False conflicts = self.geometry.conflicts_geometries.all() for conflict in conflicts: instance_objs += conflict.affected_geometry.get_data_objects() - add_message = True conflicts = self.geometry.conflicted_by_geometries.all() for conflict in conflicts: instance_objs += conflict.conflicting_geometry.get_data_objects() - add_message = True + add_message = len(instance_objs) > 0 if add_message: instance_identifiers = [x.identifier for x in instance_objs] instance_identifiers = ", ".join(instance_identifiers)