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

FEAT(sample_upload): Add special treatment for sample names

parent ea2c2b72
No related branches found
No related tags found
1 merge request!2F sample name
......@@ -145,6 +145,12 @@ def update_sample_records(data, htmluserlog_public):
raise DataInconsistencyError(msg)
# All special properties are added here
if get_column_header_name("sample_name") in data:
# We want to allow to overwrite the name with empty
# values. Note that this is cureently broken in the
# crawler and needs to be fixed there.
sample.name = return_value_if_not_none(row[get_column_header_name("sample_name")])
sample = add_special_properties(sample, row)
# Add additional properties
......
......@@ -69,6 +69,7 @@ DATATYPE_DEFINITIONS = use_custom_names({
"Longitude stop": float,
"PI": str,
"Parent LinkAhead ID": str,
"sample_name": str,
"SampleMethod": str,
"SampleType": str,
"Start date": str,
......
......@@ -41,7 +41,7 @@ from caosadvancedtools.table_importer import CSVImporter
from caoscrawler.logging import configure_server_side_logging
from bis_utils import (replace_entity_urls_by_ids,
SPECIAL_TREATMENT_SAMPLE, whitespace_cleanup_in_df)
whitespace_cleanup_in_df)
from sample_helpers.sample_upload_column_definitions import (
COLUMN_CONVERTER, DATATYPE_DEFINITIONS,
OBLIGATORY_COLUMNS, OBLIGATORY_COLUMNS_CHILD, SPECIAL_TREATMENT_SAMPLE)
......
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