Skip to content

Commit 63a1baf

Browse files
fix: more small timezone-aware fixes (ietf-tools#4489)
* fix: use meeting timezone for agenda_by_(room|type) * refactor: use timezone.override instead of timezone.activate/deactivate * fix: add timezone info in create-charter-newrevisiondocevents * fix: use meeting timezone for recording.html template * fix: use meeting timezone for slide submission timeslot display * fix: use meeting timezone for schedule diff template * fix: use meeting timezone for edit_meeting_timeslots_and_misc_sessions * fix: use meeting timezone for materials() view * fix: use meeting timezone for proceedings() view * refactor: force timestamps to utc in important_dates_for_meeting.ics Has no effect now, but guarantees consistency with template's assertion that its timestamps are in UTC. * fix: use meeting timezone for a couple interim meeting templates * fix: use meeting timezone for propose_session_slides template * fix: use meeting timezone for upload_session_*.html * fix: use meeting timezone for a couple session templates
1 parent 00cf7cf commit 63a1baf

15 files changed

Lines changed: 289 additions & 290 deletions

ietf/bin/create-charter-newrevisiondocevents

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def warn(string):
2828
# ------------------------------------------------------------------------------
2929

3030
import re
31-
from datetime import datetime as Datetime
31+
import datetime
3232

3333
import django
3434
django.setup()
@@ -44,7 +44,7 @@ system_entity = Person.objects.get(name="(System)")
4444
charterdir = Path(settings.CHARTER_PATH)
4545
for file in charterdir.files("charter-ietf-*.txt"):
4646
fname = file.name
47-
ftime = Datetime.fromtimestamp(file.mtime)
47+
ftime = datetime.datetime.fromtimestamp(file.mtime, datetime.timezone.utc)
4848
match = re.search("^(?P<name>[a-z0-9-]+)-(?P<rev>\d\d-\d\d)\.txt$", fname)
4949
if match:
5050
name = match.group("name")

ietf/meeting/views.py

Lines changed: 258 additions & 260 deletions
Large diffs are not rendered by default.

ietf/secr/templates/proceedings/recording.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% extends "base_site.html" %}
2-
{% load staticfiles %}
2+
{% load staticfiles tz %}
33

44
{% block title %}Proceedings{% endblock %}
55

@@ -59,7 +59,7 @@ <h2>{{ meeting }} - Recordings</h2>
5959
</tr>
6060
</thead>
6161
{% if sessions %}
62-
<tbody>
62+
<tbody>{% timezone meeting.time_zone %}
6363

6464
{% for session in sessions %}
6565
{% if session.recordings %}
@@ -84,7 +84,7 @@ <h2>{{ meeting }} - Recordings</h2>
8484

8585
{% endfor %}
8686

87-
</tbody>
87+
{% endtimezone %}</tbody>
8888
{% endif %}
8989
</table>
9090
</div> <!-- inline-group -->

ietf/templates/meeting/approve_proposed_slides.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% extends "base.html" %}
22
{# Copyright The IETF Trust 2015, All Rights Reserved #}
3-
{% load origin static django_bootstrap5 %}
3+
{% load origin static django_bootstrap5 tz %}
44
{% block title %}
55
Approve Slides Proposed for {{ submission.session.meeting }} : {{ submission.session.group.acronym }}
66
{% endblock %}
@@ -15,7 +15,7 @@ <h1>
1515
</h1>
1616
{% if session_number %}
1717
<h2>
18-
Session {{ session_number }} : {{ submission.session.official_timeslotassignment.timeslot.time|date:"D M-d-Y Hi" }}
18+
Session {{ session_number }} : {{ submission.session.official_timeslotassignment.timeslot.time|timezone:submission.session.meeting.time_zone|date:"D M-d-Y Hi" }}
1919
</h2>
2020
{% endif %}
2121
<p class="alert alert-info my-3">

ietf/templates/meeting/diff_schedules.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{# Copyright The IETF Trust 2020, All Rights Reserved #}
33
{% load origin %}
44
{% load ietf_filters %}
5-
{% load django_bootstrap5 %}
5+
{% load django_bootstrap5 tz %}
66
{% block title %}Differences between Meeting Agendas for IETF {{ meeting.number }}{% endblock %}
77
{% block content %}
88
{% origin %}
@@ -26,7 +26,7 @@ <h2 class="mt-4">
2626
<th scope="col"></th>
2727
</tr>
2828
</thead>
29-
<tbody>
29+
<tbody>{% timezone meeting.time_zone %}
3030
{% for d in diffs %}
3131
<tr>
3232
<td>
@@ -40,7 +40,7 @@ <h2 class="mt-4">
4040
</td>
4141
</tr>
4242
{% endfor %}
43-
</tbody>
43+
{% endtimezone %}</tbody>
4444
</table>
4545
{% else %}
4646
No differences in scheduled sessions found.

ietf/templates/meeting/important_dates_for_meeting.ics

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{% for d in meeting.important_dates %}BEGIN:VEVENT
1+
{% load tz %}{% for d in meeting.important_dates %}BEGIN:VEVENT
22
UID:ietf-{{ meeting.number }}-{{ d.name_id }}-{{ d.date.isoformat }}
33
SUMMARY:IETF {{ meeting.number }}: {{ d.name.name }}
44
CLASS:PUBLIC
55
DTSTART{% if not d.midnight_cutoff %};VALUE=DATE{% endif %}:{{ d.date|date:"Ymd" }}{% if d.midnight_cutoff %}235900Z{% endif %}
6-
DTSTAMP:{{ meeting.cached_updated|date:"Ymd" }}T{{ meeting.cached_updated|date:"His" }}Z
6+
DTSTAMP:{{ meeting.cached_updated|utc|date:"Ymd" }}T{{ meeting.cached_updated|utc|date:"His" }}Z
77
TRANSP:TRANSPARENT
88
DESCRIPTION:{{ d.name.desc }}{% if first and d.name.slug == 'openreg' or first and d.name.slug == 'earlybird' %}\n
99
Register here: https://www.ietf.org/how/meetings/register/{% endif %}{% if d.name.slug == 'opensched' %}\n

ietf/templates/meeting/interim_info.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% load ietf_filters %}
1+
{% load ietf_filters tz %}{% timezone meeting.time_zone %}
22
---------------------------------------------------------
33
{{ group.type.verbose_name }} Name: {{ group.name|safe }}
44
{% if group.type.slug == "wg" or group.type.slug == "directorate" or group.type.slug == "team" %}Area Name: {{ group.parent }}
@@ -17,3 +17,4 @@ Remote Participation Information: {{ session.remote_instructions }}
1717
Agenda Note: {{ session.agenda_note }}
1818
{% endfor %}
1919
---------------------------------------------------------
20+
{% endtimezone %}

ietf/templates/meeting/interim_session_buttons.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{# Copyright The IETF Trust 2015, All Rights Reserved #}
22
{% load origin %}
33
{% load static %}
4-
{% load textfilters %}
4+
{% load textfilters tz %}
55
{% origin %}
66
{% with item=session.official_timeslotassignment acronym=session.historic_group.acronym %}
77
<div role="group" class="btn-group btn-group-sm">
@@ -90,8 +90,8 @@
9090
{# iCalendar item #}
9191
<a class="btn btn-outline-primary"
9292
href="{% url 'ietf.meeting.views.agenda_ical' num=meeting.number session_id=session.id %}"
93-
aria-label="icalendar entry for {{ acronym }} session on {{ item.timeslot.utc_start_time|date:'Y-m-d H:i' }} UTC"
94-
title="icalendar entry for {{ acronym }} session on {{ item.timeslot.utc_start_time|date:'Y-m-d H:i' }} UTC">
93+
aria-label="icalendar entry for {{ acronym }} session on {{ item.timeslot.time|utc|date:'Y-m-d H:i' }} UTC"
94+
title="icalendar entry for {{ acronym }} session on {{ item.timeslot.time|utc|date:'Y-m-d H:i' }} UTC">
9595
<i class="bi bi-calendar"></i>
9696
</a>
9797
{% else %}

ietf/templates/meeting/propose_session_slides.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% extends "base.html" %}
22
{# Copyright The IETF Trust 2015, All Rights Reserved #}
3-
{% load origin static django_bootstrap5 %}
3+
{% load origin static django_bootstrap5 tz %}
44
{% block title %}Propose Slides for {{ session.meeting }} : {{ session.group.acronym }}{% endblock %}
55
{% block content %}
66
{% origin %}
@@ -13,7 +13,7 @@ <h1>
1313
</h1>
1414
{% if session_number %}
1515
<h2 class="mt-3">
16-
Session {{ session_number }} : {{ session.official_timeslotassignment.timeslot.time|date:"D M-d-Y Hi" }}
16+
Session {{ session_number }} : {{ session.official_timeslotassignment.timeslot.time|timezone:session.meeting.time_zone|date:"D M-d-Y Hi" }}
1717
</h2>
1818
{% endif %}
1919
<p class="alert alert-info my-3">

ietf/templates/meeting/session_buttons_include.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% load origin %}
33
{% load static %}
44
{% load textfilters %}
5-
{% load ietf_filters %}
5+
{% load ietf_filters tz %}
66
{% origin %}
77
{% if item and item|should_show_agenda_session_buttons %}
88
{% with slug=item.slug %}
@@ -130,8 +130,8 @@
130130
<a class="btn btn-outline-primary"
131131
role="button"
132132
href="{% url 'ietf.meeting.views.agenda_ical' num=meeting.number session_id=session.id %}"
133-
aria-label="icalendar entry for {{ acronym }} session on {{ timeslot.utc_start_time|date:'Y-m-d H:i' }} UTC"
134-
title="icalendar entry for {{ acronym }} session on {{ timeslot.utc_start_time|date:'Y-m-d H:i' }} UTC">
133+
aria-label="icalendar entry for {{ acronym }} session on {{ timeslot.time|utc|date:'Y-m-d H:i' }} UTC"
134+
title="icalendar entry for {{ acronym }} session on {{ timeslot.time|utc|date:'Y-m-d H:i' }} UTC">
135135
<i class="bi bi-calendar"></i>
136136
</a>
137137
{% else %}

0 commit comments

Comments
 (0)