Skip to content
Snippets Groups Projects

Fix Issue #382

Merged Magnus Giesbert requested to merge magnus/website:patch-1 into master
1 file
+ 3
2
Compare changes
  • Side-by-side
  • Inline
+ 3
2
@@ -139,10 +139,11 @@ def fetch_ro_course_events(item):
args = urllib.parse.parse_qs(url.query)
if 'pStpSpNr' in args: # Legacy URLs
id = args['pStpSpNr'][0]
elif url.path.split('/')[-2] == 'courses': # New URLs
elif len(url.path.split('/')) > 1 and url.path.split('/')[-2] == 'courses': # New URLs
id = url.path.split('/')[-1]
else:
flash("Ungültige URL: '"+i['url']+"'")
flash("Ungültige URL: '"+url.geturl()+"'")
return [] #cant get events from wrong URL so just return empty list
cal = icalendar.Calendar().from_ical(fetch_ro_course_ical(id))
events = []
for comp in cal.subcomponents:
Loading