From 2653d088c4e5fae795930c570f27e04a6ddf4a9e Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sat, 12 Oct 2024 21:15:28 +0200 Subject: [PATCH] =?UTF-8?q?Consolidation=20d=C3=A9tection=20jours?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../import_tasks/custom_extractors/acolab.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/agenda_culturel/import_tasks/custom_extractors/acolab.py b/src/agenda_culturel/import_tasks/custom_extractors/acolab.py index 579ad4d..d9e76db 100644 --- a/src/agenda_culturel/import_tasks/custom_extractors/acolab.py +++ b/src/agenda_culturel/import_tasks/custom_extractors/acolab.py @@ -32,10 +32,15 @@ class CExtractor(Extractor): def find_date(text): splited_text = text.split(' ') + + if len(splited_text) < 3: + return None + month = Extractor.guess_month(splited_text[1]) - year = splited_text[2] if month is None: return None + + year = splited_text[2] if not year.isnumeric(): return None year = int(year)