Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update purpose/types after discussions, add on_agenda Session field, …
…prevent session requests for groups with no allowed purpose, handle addition fields in session request, fix editing session requests, add session edit form/access from schedule editor, eliminate TimeSlotTypeName "private" field, add server-side timeslot type filtering to schedule editor - Legacy-Id: 19549
- Loading branch information
1 parent
5cbe402
commit 3dfce7b
Showing
21 changed files
with
323 additions
and
89 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,18 @@ | ||
# Generated by Django 2.2.24 on 2021-10-22 06:58 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('meeting', '0048_session_purpose'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='session', | ||
name='on_agenda', | ||
field=models.BooleanField(default=True, help_text='Is this session visible on the meeting agenda?'), | ||
), | ||
] |
37 changes: 37 additions & 0 deletions
37
ietf/meeting/migrations/0050_populate_session_on_agenda.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,37 @@ | ||
# Generated by Django 2.2.24 on 2021-10-22 06:58 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
def forward(apps, schema_editor): | ||
Session = apps.get_model('meeting', 'Session') | ||
SchedTimeSessAssignment = apps.get_model('meeting', 'SchedTimeSessAssignment') | ||
# find official assignments that are to private timeslots and fill in session.on_agenda | ||
private_assignments = SchedTimeSessAssignment.objects.filter( | ||
models.Q( | ||
schedule=models.F('session__meeting__schedule') | ||
) | models.Q( | ||
schedule=models.F('session__meeting__schedule__base') | ||
), | ||
timeslot__type__private=True, | ||
) | ||
Session.objects.filter(timeslotassignments__in=private_assignments).update(on_agenda=False) | ||
# Also update any sessions to match their purpose's default setting (this intentionally | ||
# overrides the timeslot settings above, but that is unlikely to matter because the | ||
# purposes will roll out at the same time as the on_agenda field) | ||
Session.objects.filter(purpose__on_agenda=False).update(on_agenda=False) | ||
Session.objects.filter(purpose__on_agenda=True).update(on_agenda=True) | ||
|
||
def reverse(apps, schema_editor): | ||
Session = apps.get_model('meeting', 'Session') | ||
Session.objects.update(on_agenda=True) # restore all to default on_agenda=True state | ||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('meeting', '0049_session_on_agenda'), | ||
] | ||
|
||
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
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
31 changes: 31 additions & 0 deletions
31
ietf/name/migrations/0037_depopulate_timeslottypename_private.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,31 @@ | ||
# Generated by Django 2.2.24 on 2021-10-25 16:58 | ||
|
||
from django.db import migrations | ||
|
||
|
||
PRIVATE_TIMESLOT_SLUGS = {'lead', 'offagenda'} # from DB 2021 Oct | ||
|
||
|
||
def forward(apps, schema_editor): | ||
TimeSlotTypeName = apps.get_model('name', 'TimeSlotTypeName') | ||
slugs = TimeSlotTypeName.objects.filter(private=True).values_list('slug', flat=True) | ||
if set(slugs) != PRIVATE_TIMESLOT_SLUGS: | ||
# the reverse migration will not restore the database, refuse to migrate | ||
raise ValueError('Disagreement between migration data and database') | ||
|
||
|
||
def reverse(apps, schema_editor): | ||
TimeSlotTypeName = apps.get_model('name', 'TimeSlotTypeName') | ||
TimeSlotTypeName.objects.filter(slug__in=PRIVATE_TIMESLOT_SLUGS).update(private=True) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('name', '0036_populate_sessionpurposename'), | ||
('meeting', '0050_populate_session_on_agenda'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forward, reverse), | ||
] |
17 changes: 17 additions & 0 deletions
17
ietf/name/migrations/0038_remove_timeslottypename_private.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,17 @@ | ||
# Generated by Django 2.2.24 on 2021-10-25 17:23 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('name', '0037_depopulate_timeslottypename_private'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='timeslottypename', | ||
name='private', | ||
), | ||
] |
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
Oops, something went wrong.