Skip to content

Commit

Permalink
Strip alternateIdentifier elements added by PASTA
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-ide committed Oct 30, 2024
1 parent 4c38dda commit 07f4691
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webapp/home/utils/load_and_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,15 @@ def strip_elements_added_by_pasta(filename:str=None, eml_node:Node=None):
dataset_node = eml_node.find_child(names.DATASET)
alternate_id_nodes = dataset_node.find_all_children(names.ALTERNATEIDENTIFIER)
for alternate_id_node in alternate_id_nodes:
if alternate_id_node and 'pasta' in alternate_id_node.content:
if alternate_id_node and ('10.6073' in alternate_id_node.content or '10.0311' in alternate_id_node.content):
node_utils.remove_child(alternate_id_node)
modified = True
distribution_nodes = dataset_node.find_all_children(names.DISTRIBUTION)
for distribution_node in distribution_nodes:
online_nodes = distribution_node.find_all_children(names.ONLINE)
for online_node in online_nodes:
url_node = online_node.find_child(names.URL)
if url_node and url_node.content and 'pasta' in url_node.content:
if url_node and url_node.content and ('10.6073' in url_node.content or '10.0311' in url_node.content):
node_utils.remove_child(distribution_node)
modified = True
if modified:
Expand Down

0 comments on commit 07f4691

Please sign in to comment.