From 8cd8b842c7040edddc0e6e7b19be930670de1021 Mon Sep 17 00:00:00 2001 From: Neda Taherifar Date: Thu, 22 Aug 2024 11:50:26 +0800 Subject: [PATCH] Format acquisition dates for correct display in preview table --- .../ckanext/igsn_theme/logic/batch_process.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py index 3ae2356e..f2fc9757 100644 --- a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py +++ b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py @@ -79,6 +79,9 @@ def prepare_samples_data(samples_df, authors_df, related_resources_df, funding_d sample['parent_sample'] = sample['parent_sample'] sample['parent'] = '' + sample['acquisition_start_date'] = row['acquisition_start_date'].strftime('%Y-%m-%d') if pd.notnull(row['acquisition_start_date']) else None + sample['acquisition_end_date'] = row['acquisition_end_date'].strftime('%Y-%m-%d') if pd.notnull(row['acquisition_end_date']) else None + org = toolkit.get_action('organization_show')({}, {'id': org_id}) sample['owner_org'] = org_id sample['sample_repository_contact_name'] = org.get('contact_name', 'test')