From 4fd90d7824878e84007862ada8122581fd52c8fa Mon Sep 17 00:00:00 2001 From: Birger Schacht Date: Mon, 20 Jan 2025 10:39:11 +0100 Subject: [PATCH] fix(importers): use `content_object` instead of `root_object` --- apis_ontology/importers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apis_ontology/importers.py b/apis_ontology/importers.py index 32c58ad..31cb041 100644 --- a/apis_ontology/importers.py +++ b/apis_ontology/importers.py @@ -17,16 +17,16 @@ def create_instance(self): data["sameas"] = data["sameas"].split("|") sa = Uri.objects.filter(uri__in=data["sameas"]) if sa.count() == 1: - return sa.first().root_object + return sa.first().content_object elif sa.count() > 1: - root_set = set([s.root_object for s in sa]) + root_set = set([s.content_object for s in sa]) if len(root_set) > 1: raise IntegrityError( f"Multiple objects found for sameAs URIs {data['sames']}. " f"This indicates a data integrity problem as these URIs should be unique." ) else: - return sa.first().root_object + return sa.first().content_object modelfields = [field.name for field in self.model._meta.fields] data_croped = {key: data[key] for key in data if key in modelfields} subj = self.model.objects.create(**data_croped)