Skip to content

Commit 15ff245

Browse files
committed
Fixed "%2C" bug introducted (exposed?) by Apple's iCloud handling of URLs
- Legacy-Id: 4992
1 parent 5e38459 commit 15ff245

1 file changed

Lines changed: 11 additions & 16 deletions

File tree

ietf/meeting/views.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -422,18 +422,10 @@ def week_view(request, num=None):
422422
{"timeslots":timeslots,"render_types":["Session","Other","Break","Plenary"]}, context_instance=RequestContext(request))
423423

424424
def ical_agenda(request, num=None):
425-
# The timezone situation here remains tragic, but I've burned
426-
# hours trying to figure out how to get the information I need
427-
# in python. I can do this trivially in perl with its Ical module,
428-
# but the icalendar module in python seems staggeringly less
429-
# capable. There might be a path to success here, but I'm not
430-
# completely convinced. So I'm going to spend some time
431-
# working on more urgent matters for now. -Adam
432-
433425
meeting = get_meeting(num)
434426

435427
q = request.META.get('QUERY_STRING','') or ""
436-
filter = q.lower().split(',');
428+
filter = q.lower().replace('%2c',',').split(',');
437429
include = set(filter)
438430
include_types = ["Plenary","Other"]
439431
exclude = []
@@ -455,13 +447,16 @@ def ical_agenda(request, num=None):
455447
#Q(session__group__parent__acronym__in = exclude))
456448

457449
if meeting.time_zone:
458-
tzfn = os.path.join(settings.TZDATA_ICS_PATH, meeting.time_zone + ".ics")
459-
tzf = open(tzfn)
460-
icstext = tzf.read()
461-
debug.show('icstext[:128]')
462-
vtimezone = re.search("(?sm)(\nBEGIN:VTIMEZONE.*\nEND:VTIMEZONE\n)", icstext).group(1).strip()
463-
debug.show('vtimezone[:128]')
464-
tzf.close()
450+
try:
451+
tzfn = os.path.join(settings.TZDATA_ICS_PATH, meeting.time_zone + ".ics")
452+
tzf = open(tzfn)
453+
icstext = tzf.read()
454+
debug.show('icstext[:128]')
455+
vtimezone = re.search("(?sm)(\nBEGIN:VTIMEZONE.*\nEND:VTIMEZONE\n)", icstext).group(1).strip()
456+
debug.show('vtimezone[:128]')
457+
tzf.close()
458+
except IOError:
459+
vtimezone = None
465460
else:
466461
vtimezone = None
467462

0 commit comments

Comments
 (0)