Skip to content

Commit 5a60a3c

Browse files
committed
Improved the handling of iCalendar timezone information -- instead of simplified VTIMEZONE information generated from a template, the VTIMEZONE information for a meeting's timezone is read from file (where it presumably has been generated from the Olson timezone database, for instance using vzic.
- Legacy-Id: 4956
1 parent 09c891e commit 5a60a3c

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

ietf/meeting/views.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
from django.middleware.gzip import GZipMiddleware
2121
from django.db.models import Max
2222

23+
import debug
24+
2325
from ietf.idtracker.models import InternetDraft
2426
from ietf.utils.pipe import pipe
2527
from ietf.utils.history import find_history_active_at
@@ -452,8 +454,19 @@ def ical_agenda(request, num=None):
452454
#Q(session__group__acronym__in = exclude) |
453455
#Q(session__group__parent__acronym__in = exclude))
454456

457+
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()
465+
else:
466+
vtimezone = None
467+
455468
return HttpResponse(render_to_string("meeting/agendaREDESIGN.ics",
456-
{"timeslots":timeslots, "meeting":meeting },
469+
{"timeslots":timeslots, "meeting":meeting, "vtimezone": vtimezone },
457470
RequestContext(request)), mimetype="text/calendar")
458471

459472
def csv_agenda(request, num=None):

0 commit comments

Comments
 (0)