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): ...@@ -635,25 +635,25 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter):
return None return None
return candidates[0] 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 returns the registered identifiable for the given Record
It is assumed, that there is exactly one identifiable for each RecordType. Only the first 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 parent of the given Record is considered; others are ignored
""" """
if len(entity.parents) == 0: if len(record.parents) == 0:
return None return None
registerd = [] registered = []
for parent in entity.parents: for parent in record.parents:
prt = _retrieve_RecordType(id=parent.id, name=parent.name) prt = _retrieve_RecordType(id=parent.id, name=parent.name)
reg = self._get_registered_for_rt(prt) reg = self._get_registered_for_rt(prt)
if reg is not None: if reg is not None:
registerd.append(reg) registered.append(reg)
if len(registerd) > 1: if len(registered) > 1:
raise RuntimeError("Multiple registered identifiables found.") raise RuntimeError("Multiple registered identifiables found.")
elif len(registerd) == 1: elif len(registered) == 1:
return registerd[0] return registered[0]
else: else:
return None return None
...@@ -667,14 +667,14 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter): ...@@ -667,14 +667,14 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter):
return self._registered_identifiables[rt.name.lower()] return self._registered_identifiables[rt.name.lower()]
if len(rt.parents) == 0: if len(rt.parents) == 0:
return None return None
registerd = [] registered = []
for parent in rt.parents: for parent in rt.parents:
prt = _retrieve_RecordType(id=parent.id, name=parent.name) prt = _retrieve_RecordType(id=parent.id, name=parent.name)
registerd.append(self._get_registered_for_rt(prt)) registered.append(self._get_registered_for_rt(prt))
if len(registerd) > 1: if len(registered) > 1:
raise RuntimeError("Multiple registered identifiables found.") raise RuntimeError("Multiple registered identifiables found.")
elif len(registerd) == 1: elif len(registered) == 1:
return registerd[0] return registered[0]
else: else:
return None return None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment