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

FIX: rename vars

parent 3db75326
No related branches found
No related tags found
2 merge requests!217TST: Make NamedTemporaryFiles Windows-compatible,!212ENH: introduce inheritance of identifiables
Pipeline #59879 canceled
......@@ -635,25 +635,25 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter):
return None
return candidates[0]
def get_registered_identifiable(self, entity: db.Entity):
def get_registered_identifiable(self, record: db.Entity):
"""
returns the registered identifiable for the given Record
It is assumed, that there is exactly one identifiable for each RecordType. Only the first
parent of the given Record is considered; others are ignored
"""
if len(entity.parents) == 0:
if len(record.parents) == 0:
return None
registerd = []
for parent in entity.parents:
registered = []
for parent in record.parents:
prt = _retrieve_RecordType(id=parent.id, name=parent.name)
reg = self._get_registered_for_rt(prt)
if reg is not None:
registerd.append(reg)
if len(registerd) > 1:
registered.append(reg)
if len(registered) > 1:
raise RuntimeError("Multiple registered identifiables found.")
elif len(registerd) == 1:
return registerd[0]
elif len(registered) == 1:
return registered[0]
else:
return None
......@@ -667,14 +667,14 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter):
return self._registered_identifiables[rt.name.lower()]
if len(rt.parents) == 0:
return None
registerd = []
registered = []
for parent in rt.parents:
prt = _retrieve_RecordType(id=parent.id, name=parent.name)
registerd.append(self._get_registered_for_rt(prt))
if len(registerd) > 1:
registered.append(self._get_registered_for_rt(prt))
if len(registered) > 1:
raise RuntimeError("Multiple registered identifiables found.")
elif len(registerd) == 1:
return registerd[0]
elif len(registered) == 1:
return registered[0]
else:
return None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment