Skip to content

Commit

Permalink
fix: prevent double import of nested publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
katharinawuensche committed Dec 21, 2023
1 parent 8344840 commit 87934fe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apis_ontology/ontology_specific_scripts/import_tei.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@ def parse_attr(path_node: PathNode):
"date": None
}

if (
xml_elem.tag.endswith("publisher")
and path_node.path_node_parent.xml_elem.tag.endswith("rs")
and path_node.path_node_parent.xml_elem.attrib.get("type", "") == "publisher"
):
return None

if (
(
xml_elem.tag.endswith("publisher")
Expand Down Expand Up @@ -284,7 +291,7 @@ def parse_attr(path_node: PathNode):
if attr_dict["name"] is not None:
attr_dict["name"] = attr_dict["name"].replace("&", "&")

return attr_dict
return attr_dict

else:

Expand Down

0 comments on commit 87934fe

Please sign in to comment.