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

FIX: Multiple registered identifiables error when multiple parents exist

parent 7a6252ad
No related branches found
No related tags found
2 merge requests!222Release 0.12.0,!218Multiple registered identifiables error when multiple parents exist
Pipeline #62052 passed
......@@ -672,11 +672,15 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter):
registered = []
for parent in rt.parents:
prt = _retrieve_RecordType(id=parent.id, name=parent.name)
registered.append(self._get_registered_for_rt(prt))
reg = self._get_registered_for_rt(prt)
if reg is not None:
registered.append(reg)
# TODO we might in future want to check whether the registered identifiables are the same
if len(registered) > 1:
raise RuntimeError("Multiple registered identifiables found for the RecordType "
f" {rt.name} with the following parents: {rt.parents}")
ri_names = [i.name for i in registered]
raise RuntimeError(f"Multiple registered identifiables found for the RecordType "
f" {rt.name} with the following parents: {rt.parents}\n"
f"Registered identifiables: {', '.join(ri_names)}")
elif len(registered) == 1:
return registered[0]
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment