Browse Source

ICS: pure talk senza location

boyska 7 years ago
parent
commit
16fa06f26d
1 changed files with 3 additions and 2 deletions
  1. 3 2
      plugins/talks.py

+ 3 - 2
plugins/talks.py

@@ -315,7 +315,7 @@ def talks_to_ics():
 
 
 def talk_to_ics(talk):
-    if 'time' not in talk or 'duration' not in talk or 'room' not in talk:
+    if 'time' not in talk or 'duration' not in talk:
         return ''
     start = talk['time']
     end = start + datetime.timedelta(minutes=talk['duration'])
@@ -331,7 +331,8 @@ def talk_to_ics(talk):
     content += "DTEND:%s\n" % time.strftime('%Y%m%dT%H%M%SZ',
                                             time.gmtime(float(
                                                   end.strftime('%s'))))
-    content += "LOCATION:%s\n" % talk['room']
+    
+    content += "LOCATION:%s\n" % (talk['room'] if 'room' in talk else 'todo')
     content += 'END:VEVENT\n'
     return content