Commit 681218a6 authored by Katia Saurfelt's avatar Katia Saurfelt
Browse files

fix(rdf): check child_authority_record exists

parent 7fd4b7c9bed2
Pipeline #135423 failed with stages
in 2 minutes and 15 seconds
......@@ -353,14 +353,15 @@ class AuthorityRecordRICORDFAdapter(EntityRDFAdapter):
"D start_date START?, D end_date END?",
{"eid": self.entity.eid},
)
child_authority_record = None
if sub_organizations:
for agent_eid, desc, start, end in sub_organizations:
child_authority_record = self._cw.entity_from_eid(agent_eid)
relation_uri = directional_relation_uri(
"hierarchical", self.entity, child_authority_record
)
child_uri = child_authority_record.cw_adapt_to(self.__regid__).agent_uri
if child_authority_record:
child_uri = child_authority_record.cw_adapt_to(self.__regid__).agent_uri
yield from self.hierarchical_triples(
relation_uri, self.agent_uri, child_uri, desc, start, end
......@@ -382,9 +383,10 @@ class AuthorityRecordRICORDFAdapter(EntityRDFAdapter):
"hierarchical", parent_authority_record, self.entity
)
parent_uri = child_authority_record.cw_adapt_to(
self.__regid__
).agent_uri
if child_authority_record:
parent_uri = child_authority_record.cw_adapt_to(
self.__regid__
).agent_uri
parent_uri = (
self._cw.entity_from_eid(agent_eid)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment