diff --git a/src/caosdb/apiutils.py b/src/caosdb/apiutils.py index 4c8393111bcbb4f9f91e309b81bebdcac55ba626..882772098a361e10322ae194dc94814466de7d4c 100644 --- a/src/caosdb/apiutils.py +++ b/src/caosdb/apiutils.py @@ -338,11 +338,14 @@ def merge_entities(entity_a: Entity, entity_b: Entity): raise NotImplementedError() for attribute in ("datatype", "unit", "value"): - if diff_r1["properties"][key][attribute] is None: - setattr(entity_a.get_property(key), attribute, - diff_r2["properties"][key][attribute]) - else: - raise RuntimeError("Merge conflict.") + if (attribute in diff_r2["properties"][key] and + diff_r2["properties"][key][attribute] is not None): + print(diff_r2["properties"][key][attribute]) + if (diff_r1["properties"][key][attribute] is None): + setattr(entity_a.get_property(key), attribute, + diff_r2["properties"][key][attribute]) + else: + raise RuntimeError("Merge conflict.") else: # TODO: This is a temporary FIX for # https://gitlab.indiscale.com/caosdb/src/caosdb-pylib/-/issues/105