parent
eaf1f01e4d
commit
38883e506f
29
ietf/group/migrations/0054_enable_delegation.py
Normal file
29
ietf/group/migrations/0054_enable_delegation.py
Normal 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),
|
||||
]
|
Loading…
Reference in a new issue