forked from boyska/sito-hackit-17
FIX errori su talk con day/time incompleto
This commit is contained in:
parent
bc99069bee
commit
3e271ae577
1 changed files with 5 additions and 1 deletions
|
@ -128,6 +128,10 @@ def get_talk_data(talkname):
|
||||||
logging.warn("Talk <{}> has no `room` field".format(talkname))
|
logging.warn("Talk <{}> has no `room` field".format(talkname))
|
||||||
if 'time' not in data or 'day' not in data:
|
if 'time' not in data or 'day' not in data:
|
||||||
logging.warn("Talk <{}> has no `time` or `day`".format(talkname))
|
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:
|
if 'day' in data:
|
||||||
data['day'] = get_global_data()['startdate'] + datetime.timedelta(days=data['day'])
|
data['day'] = get_global_data()['startdate'] + datetime.timedelta(days=data['day'])
|
||||||
if 'time' in data and 'day' in data:
|
if 'time' in data and 'day' in data:
|
||||||
|
@ -266,7 +270,7 @@ def talks_to_ics():
|
||||||
|
|
||||||
|
|
||||||
def talk_to_ics(talk):
|
def talk_to_ics(talk):
|
||||||
if 'time' not in talk:
|
if 'time' not in talk or 'duration' not in talk:
|
||||||
return ''
|
return ''
|
||||||
start = talk['time']
|
start = talk['time']
|
||||||
end = start + datetime.timedelta(minutes=talk['duration'])
|
end = start + datetime.timedelta(minutes=talk['duration'])
|
||||||
|
|
Loading…
Reference in a new issue