silently skip invalid schedule data (#26912)
This commit is contained in:
parent
42cf0c7303
commit
e83aba4a50
|
@ -160,7 +160,10 @@ def parse_opening_hours_data(mairie_data):
|
|||
"""
|
||||
for openinghours in mairie_data.get('openinghours', []):
|
||||
# format is comma-separated days and/or intervals, or only one day
|
||||
groups = re.match('(\w\w(?:(?:,|\-)?\w\w)*) (\d\d?):(\d\d?)-(\d\d?):(\d\d?)', openinghours).groups()
|
||||
try:
|
||||
groups = re.match('(\w\w(?:(?:,|\-)?\w\w)*) (\d\d?):(\d\d?)-(\d\d?):(\d\d?)', openinghours).groups()
|
||||
except AttributeError: # invalid input data
|
||||
continue
|
||||
for day in groups[0].split(','):
|
||||
if '-' in day:
|
||||
# interval
|
||||
|
|
Loading…
Reference in New Issue