From c2198c0be451d4be910e32e3bb2ad00af437f178 Mon Sep 17 00:00:00 2001
From: Alexander Schlemmer <alexander@mail-schlemmer.de>
Date: Mon, 22 Nov 2021 20:59:15 +0100
Subject: [PATCH] FIX: compare entities had not compared values of entites

---
 src/caosdb/apiutils.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/caosdb/apiutils.py b/src/caosdb/apiutils.py
index 2813d91b..e6b4dc4e 100644
--- a/src/caosdb/apiutils.py
+++ b/src/caosdb/apiutils.py
@@ -639,6 +639,13 @@ def compare_entities(old_entity: Entity, new_entity: Entity):
                 newdiff["properties"][prop.name]["datatype"] = \
                     matching[0].datatype
 
+            if ((prop.value is not None and
+                    matching[0].value is not None) and
+                    (prop.value != matching[0].value)):
+                olddiff["properties"][prop.name]["value"] = prop.value
+                newdiff["properties"][prop.name]["value"] = \
+                    matching[0].value
+
             if (len(newdiff["properties"][prop.name]) == 0
                     and len(olddiff["properties"][prop.name]) == 0):
                 newdiff["properties"].pop(prop.name)
-- 
GitLab