don't crash on places that are always closed (#17841)

This commit is contained in:
Frédéric Péters 2017-07-29 09:21:17 +02:00
parent 9ea4def4ec
commit a447717fb0
1 changed files with 4 additions and 1 deletions

View File

@ -57,7 +57,10 @@ def as_opening_hours_badge(data):
slots[i] = None
slots = [x for x in slots if x]
if now < slots[0].start:
if not slots:
klass = 'closed'
label = u'Fermé'
elif now < slots[0].start:
klass = 'closed'
verb = u'Réouvre'
if slots[0].start.weekday() == today.weekday():