From 60d520a3e2a433571b02fce8f9688827ed995f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Antoine=20Dupr=C3=A9?= Date: Wed, 19 Jun 2024 08:54:32 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20[BUG]=20Apidae=20tourism=20parse?= =?UTF-8?q?r=20now=20handles=20missing=20contact=20properties?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/changelog.rst | 1 + geotrek/tourism/parsers.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 32d9659340..e9e13c8ed5 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -19,6 +19,7 @@ CHANGELOG - ApidaeTrekParser now fallbacks on trace filename extension if no extension property - ApidaeTrekParser now ignores when no linestring in GPX - ApidaeTrekParser duration import is fixed for multiple-days treks +- Apidae tourism parser now handles missing contact properties 2.109.1 (2024-08-22) ---------------------------- diff --git a/geotrek/tourism/parsers.py b/geotrek/tourism/parsers.py index 43c4a95360..37f02992ef 100644 --- a/geotrek/tourism/parsers.py +++ b/geotrek/tourism/parsers.py @@ -107,7 +107,7 @@ def _filter_comm(self, val, code, multiple=True): """ if not val: return None - vals = [subval['coordonnees']['fr'] for subval in val if subval['type']['id'] == code] + vals = [subval['coordonnees']['fr'] for subval in val if subval.get('type', {}).get('id') == code] if multiple: return ' / '.join(vals) if vals: