fix: enable delegation for many group types. (#3753)

fixes #3740
This commit is contained in:
Robert Sparks 2022-03-25 11:56:49 -05:00 committed by GitHub
parent eaf1f01e4d
commit 38883e506f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,29 @@
# Copyright The IETF Trust 2022 All Rights Reserved
from django.db import migrations
def forward(apps, schema_editor):
GroupFeatures = apps.get_model('group','GroupFeatures')
for type_id in ('dir', 'iabasg', 'program', 'review', 'team'):
f = GroupFeatures.objects.get(type_id=type_id)
if 'delegate' not in f.groupman_roles:
f.groupman_roles.append('delegate')
f.save()
for type_id in ('adhoc', 'ag', 'iesg', 'irtf', 'ise', 'rag', 'dir', 'iabasg', 'program', 'review'):
f = GroupFeatures.objects.get(type_id=type_id)
if 'delegate' not in f.default_used_roles:
f.default_used_roles.append('delegate')
f.save()
def reverse (apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
('group', '0053_populate_groupfeatures_session_purposes'),
]
operations = [
migrations.RunPython(forward,reverse),
]