forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0054_enable_delegation.py
More file actions
29 lines (23 loc) · 955 Bytes
/
Copy path0054_enable_delegation.py
File metadata and controls
29 lines (23 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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),
]