-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow agenda_note to be edited from the schedule editor (#5115)
* feat: Add agenda_note to the SessionDetailsForm * fix: Add hidden agenda_note field to session_details_form.html * fix: Stop using agenda_note to filter sessions in import_audio_files() * chore: Migrate sessions with agenda_note='CANCELED' to canceled state
- Loading branch information
1 parent
6bbad15
commit 1fc2042
Showing
4 changed files
with
54 additions
and
8 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
49 changes: 49 additions & 0 deletions
49
ietf/meeting/migrations/0060_normalize_canceled_sessions.py
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,49 @@ | ||
# Generated by Django 2.2.28 on 2023-02-08 22:41 | ||
|
||
from django.db import migrations | ||
from django.db.models import Subquery, OuterRef, Value, TextField | ||
from django.db.models.functions import Coalesce | ||
|
||
|
||
def forward(apps, schema_editor): | ||
Session = apps.get_model('meeting', 'Session') | ||
SchedulingEvent = apps.get_model('meeting', 'SchedulingEvent') | ||
Person = apps.get_model('person', 'Person') | ||
|
||
# annotation borrowed from SessionQuerySet.with_current_status() | ||
sessions = Session.objects.annotate( | ||
# coalesce with '' to avoid nulls which give funny | ||
# results, e.g. .exclude(current_status='canceled') also | ||
# skips rows with null in them | ||
current_status=Coalesce( | ||
Subquery( | ||
SchedulingEvent.objects.filter( | ||
session=OuterRef('pk') | ||
).order_by( | ||
'-time', '-id' | ||
).values('status')[:1]), | ||
Value(''), | ||
output_field=TextField()), | ||
).exclude( | ||
current_status__in=['canceled', 'canceledpa'], | ||
) | ||
system_person = Person.objects.get(name='(System)') | ||
|
||
# Cancel any uncanceled sessions marked as 'CANCELED' in the agenda_note | ||
for session in sessions.filter(agenda_note='CANCELED'): | ||
SchedulingEvent.objects.create(session=session, status_id='canceled', by=system_person) | ||
|
||
|
||
def reverse(apps, schema_editor): | ||
pass # nothing to be done | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('meeting', '0059_rename_sessions'), | ||
] | ||
|
||
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