don't return schedule array when it's all closed
This commit is contained in:
parent
2a48ad2a6a
commit
3cb9c801e0
|
@ -275,6 +275,11 @@ def get_mairie_opening_hours(mairie_data):
|
|||
opening_time.strftime('%H'), opening_time.strftime('%M'),
|
||||
closing_time.strftime('%H'), closing_time.strftime('%M'))
|
||||
|
||||
if not (any([x['am'] for x in opening_hours_dict.values()]) or
|
||||
any([x['pm'] for x in opening_hours_dict.values()])):
|
||||
# always closed, return None to mark unavailability
|
||||
return None
|
||||
|
||||
return [
|
||||
(FR_ABBREV_WEEKDAYS_LIST[weekday], hours) for weekday, hours in opening_hours_dict.items()
|
||||
if not (weekday in ['sa', 'su'] and not hours['am'] and not hours['pm'])
|
||||
|
|
Loading…
Reference in New Issue