Skip to content
Snippets Groups Projects
Commit 29dc4b42 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

EN: Also support parent/child samples

parent 7d04de0c
No related branches found
No related tags found
1 merge request!1F awi sams
......@@ -65,6 +65,7 @@ entity_names:
start_date_prop: start_date
end_date_prop: end_date
igsn_doi_prop: igsn_doi
parent_sample_prop: Parent_Sample
error_prefix: "Something went wrong:"
error_suffix: "Please contact your administrator(s)."
......@@ -34,6 +34,7 @@ def add_special_properties(sample: db.Record, data: pd.Series) -> db.Record:
main_user_prop = db.get_entity_by_name(get_entity_name("Main User"))
container_rt = db.get_entity_name(get_entity_name("container_rt"))
parent_sample_prop = db.get_entity_name(get_entity_name("parent_sample_prop"))
if (get_column_header_name("Main User") in data and
return_value_if_not_none(data[get_column_header_name("Main User")]) is not None):
......@@ -46,8 +47,14 @@ def add_special_properties(sample: db.Record, data: pd.Series) -> db.Record:
data[get_column_header_name("Storage ID")]))
sample = update_property(sample, container_rt.id, container)
if (get_column_header_name("Parent LinkAhead ID") in data and
return_value_if_not_none(data[get_column_header_name("Parent LinkAhead ID")]) is not None):
parent = return_value_if_not_none(
data[get_column_header_name("Parent LinkAhead ID")])
sample = update_property(sample, parent_sample_prop.id, parent)
for name in ["Curator", "Collector"]:
prop = db.get_entity_by_name(name)
prop = db.get_entity_by_name(get_entity_name(name))
if (get_column_header_name(name) in data and
return_value_if_not_none(data[get_column_header_name(name)]) is not None):
persons = [get_person(id_str) for id_str in return_value_if_not_none(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment