From 01714b3ad8cc1646a7563d41b3a4a305a2f4e756 Mon Sep 17 00:00:00 2001 From: florian <f.spreckelsen@inidscale.com> Date: Tue, 8 Nov 2022 16:41:05 +0100 Subject: [PATCH] FIX: Fix empty_diff for special properties --- src/caosdb/apiutils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/caosdb/apiutils.py b/src/caosdb/apiutils.py index 0651e493..0862cf9f 100644 --- a/src/caosdb/apiutils.py +++ b/src/caosdb/apiutils.py @@ -353,10 +353,14 @@ def empty_diff(old_entity: Entity, new_entity: Entity, compare_referenced_record olddiff, newdiff = compare_entities( old_entity, new_entity, compare_referenced_records) for diff in [olddiff, newdiff]: - for key in diff: + for key in ["parents", "properties"]: if len(diff[key]) > 0: # There is a difference somewhere in the diff return False + for key in SPECIAL_ATTRIBUTES: + if key in diff and diff[key]: + # There is a difference in at least one special attribute + return False # all elements of the two diffs were empty return True -- GitLab