From 706dc3409221ddde895499d06514c795986e1bf5 Mon Sep 17 00:00:00 2001 From: Peter Weber Date: Wed, 17 Apr 2024 10:02:26 +0200 Subject: [PATCH] import: fix work access point * Fixes `_do_work_access_point_creator` date creation. Co-Authored-by: Peter Weber --- .../modules/documents/dojson/contrib/marc21tojson/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rero_ils/modules/documents/dojson/contrib/marc21tojson/utils.py b/rero_ils/modules/documents/dojson/contrib/marc21tojson/utils.py index 3470a5b305..421c30169a 100644 --- a/rero_ils/modules/documents/dojson/contrib/marc21tojson/utils.py +++ b/rero_ils/modules/documents/dojson/contrib/marc21tojson/utils.py @@ -1724,9 +1724,9 @@ def _do_work_access_point_creator(marc21, key, value): not_repetitive(bib_id, bib_id, key, value, 'b')) if date := not_repetitive(bib_id, bib_id, key, value, 'd'): date_parts = [d.strip().rstrip('.') for d in date.split('-')] - if date_parts[0]: + if date_parts and date_parts[0]: data['date_of_birth'] = date_parts[0] - if date_parts[1]: + if len(date_parts) > 1 and date_parts[1]: data['date_of_death'] = date_parts[1] if value.get('c'): data['qualifier'] = remove_trailing_punctuation(