Skip to content
Snippets Groups Projects
Commit 53d452c6 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: fix datatype comparison

parent f2a2df0f
No related branches found
No related tags found
2 merge requests!159Release 0.16.o,!155Review filter lists and compare_entities
Pipeline #56097 passed with warnings
......@@ -248,6 +248,21 @@ def compare_entities(old_entity: Entity,
if old_entity_attr_na and new_entity_attr_na:
continue
# treat datatype separately: if datatype is an object on one side and string on the other.
if attr == "datatype":
if (not old_entity_attr_na and not new_entity_attr_na):
if isinstance(oldattr, RecordType):
if oldattr.name == newattr:
continue
if oldattr.id == newattr:
continue
if isinstance(newattr, RecordType):
if newattr.name == oldattr:
continue
if newattr.id == oldattr:
continue
# only one set or different values
if ((old_entity_attr_na ^ new_entity_attr_na)
or (oldattr != newattr)):
......@@ -257,6 +272,7 @@ def compare_entities(old_entity: Entity,
if not new_entity_attr_na:
newdiff[attr] = newattr
# value
if (old_entity.value != new_entity.value):
# basic comparison of value objects says they are different
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment