From 0f5fc1ca0897161b4a5f25cbc93be616ab4293b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 17 Aug 2019 09:03:58 +0200 Subject: [PATCH] misc: workaround empty opens/closes attributes (#35420) --- combo_plugin_gnm/templatetags/gnm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/combo_plugin_gnm/templatetags/gnm.py b/combo_plugin_gnm/templatetags/gnm.py index b52cb57..e9aceff 100644 --- a/combo_plugin_gnm/templatetags/gnm.py +++ b/combo_plugin_gnm/templatetags/gnm.py @@ -202,7 +202,7 @@ def get_slots_from_mairie_format(data, base_datetime): valid_through = parse_datetime(specification.get('validThrough')) if specification.get('validThrough') else next_week if not valid_from or not valid_through: continue - if 'opens' in specification and 'closes' in specification: + if specification.get('opens') and specification.get('closes'): # case when opening periods are defined if base_datetime >= valid_from and base_datetime < valid_through: (opening_time, closing_time, day_number) = get_open_close_from_specification(