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

MAINT: do not allow Identifiable for nodes without registered ident

parent 28b1b816
No related branches found
No related tags found
2 merge requests!178FIX: #96 Better error output for crawl.py script.,!167Sync Graph
Pipeline #50843 passed with warnings
......@@ -288,20 +288,16 @@ startswith: bool, optional
Identifiable, the identifiable for record.
"""
registered_identifiable = se.registered_identifiable
property_name_list_A = []
property_name_list_B = []
identifiable_props = {}
name = None
# TODO
# if registered_identifiable is None:
# raise ValueError("no register_identifiable")
if se.registered_identifiable is None:
raise ValueError("no register_identifiable")
if registered_identifiable is not None:
# fill the values:
for prop in registered_identifiable.properties:
for prop in se.registered_identifiable.properties:
if prop.name == "name":
name = se.name
continue
......@@ -316,7 +312,7 @@ startswith: bool, optional
if len(identifiable_backrefs) == 0:
raise MissingReferencingEntityError(
f"Could not find referencing entities of type(s): {prop.value}\n"
f"for registered identifiable:\n{registered_identifiable}\n"
f"for registered identifiable:\n{se.registered_identifiable}\n"
f"There were {len(identifiable_backrefs)} referencing entities to choose from.\n"
f"This error can also occur in case of merge conflicts in the referencing entities."
)
......@@ -361,8 +357,7 @@ startswith: bool, optional
return Identifiable(
record_id=se.id,
path=se.path,
record_type=(registered_identifiable.parents[0].name
if registered_identifiable else None),
record_type=se.registered_identifiable.parents[0].name,
name=name,
properties=identifiable_props,
backrefs=[e.id for e in identifiable_backrefs]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment