FIX errori su talk con day/time incompleto

This commit is contained in:
boyska 2017-05-18 20:38:30 +02:00
parent bc99069bee
commit 3e271ae577
No known key found for this signature in database
GPG key ID: 7395DCAE58289CA9

View file

@ -128,6 +128,10 @@ def get_talk_data(talkname):
logging.warn("Talk <{}> has no `room` field".format(talkname))
if 'time' not in data or 'day' not in data:
logging.warn("Talk <{}> has no `time` or `day`".format(talkname))
if 'time' in data:
del data['time']
if 'day' in data:
del data['day']
if 'day' in data:
data['day'] = get_global_data()['startdate'] + datetime.timedelta(days=data['day'])
if 'time' in data and 'day' in data:
@ -266,7 +270,7 @@ def talks_to_ics():
def talk_to_ics(talk):
if 'time' not in talk:
if 'time' not in talk or 'duration' not in talk:
return ''
start = talk['time']
end = start + datetime.timedelta(minutes=talk['duration'])