-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Use session name instead of timeslot name on agenda (#5086)
* fix: Use session name instead of timeslot name on agenda * test: Fix failing playwright test * test: Test name/slotName values from agenda_extract_schedule() * chore: Migrate sessions to use timeslot names for IETF meetings
- Loading branch information
1 parent
9a673a2
commit 6cfbab6
Showing
5 changed files
with
84 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Generated by Django 2.2.28 on 2023-02-06 22:20 | ||
from django.db import migrations | ||
from django.db.models import ExpressionWrapper, F, IntegerField | ||
|
||
|
||
def forward(apps, schema_editor): | ||
Meeting = apps.get_model('meeting', 'Meeting') | ||
meetings = Meeting.objects.filter(type='ietf', schedule__isnull=False).annotate( | ||
number_as_int=ExpressionWrapper(F('number'), output_field=IntegerField()) | ||
).order_by('date') | ||
# print('session.pk,meeting.number,session.name,timeslot.name') | ||
for m in meetings.filter(number_as_int__lt=91): | ||
# until meeting 91, TimeSlots had the more descriptive names | ||
for assignment in m.schedule.assignments.exclude(session__type='regular').exclude(session__name=F('timeslot__name')): | ||
# print(f'{assignment.session.pk},{m.number},{assignment.session.name},{assignment.timeslot.name}') | ||
assignment.session.name = assignment.timeslot.name | ||
assignment.session.save() | ||
|
||
# meetings 91-98 had no differences or were better off with session names as they were | ||
|
||
for m in meetings.filter(number_as_int__gte=99): | ||
# for meetings 99+, TimeSlots again had the better names | ||
for assignment in m.schedule.assignments.exclude(session__type='regular').exclude(session__name=F('timeslot__name')): | ||
# print(f'{assignment.session.pk},{m.number},{assignment.session.name},{assignment.timeslot.name}') | ||
assignment.session.name = assignment.timeslot.name | ||
assignment.session.save() | ||
|
||
|
||
def reverse(apps, schema_editor): | ||
pass # can't undo | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('meeting', '0058_meeting_time_zone_not_blank'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forward, reverse), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters