misc: workaround empty opens/closes attributes (#35420)

This commit is contained in:
Frédéric Péters 2019-08-17 09:03:58 +02:00
parent cafa8c88e4
commit 0f5fc1ca08
1 changed files with 1 additions and 1 deletions

View File

@ -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(