forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0025_populate_groupman_authroles.py
More file actions
47 lines (40 loc) · 1.27 KB
/
0025_populate_groupman_authroles.py
File metadata and controls
47 lines (40 loc) · 1.27 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-05-01 12:54
from __future__ import unicode_literals
from django.db import migrations
authroles_map = {
'adhoc': ['Secretariat'],
'admin': ['Secretariat'],
'ag': ['Secretariat', 'Area Director'],
'area': ['Secretariat'],
'dir': ['Secretariat'],
'iab': ['Secretariat'],
'iana': ['Secretariat'],
'iesg': ['Secretariat'],
'ietf': ['Secretariat'],
'individ': [],
'irtf': ['Secretariat'],
'ise': ['Secretariat'],
'isoc': ['Secretariat'],
'nomcom': ['Secretariat'],
'program': ['Secretariat', 'IAB'],
'review': ['Secretariat'],
'rfcedtyp': ['Secretariat'],
'rg': ['Secretariat', 'IRTF Chair'],
'sdo': ['Secretariat'],
'team': ['Secretariat'],
'wg': ['Secretariat', 'Area Director'],
}
def forward(apps, schema_editor):
GroupFeatures = apps.get_model('group', 'GroupFeatures')
for type_id, authroles in authroles_map.items():
GroupFeatures.objects.filter(type_id=type_id).update(groupman_authroles=authroles)
def reverse(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
('group', '0024_add_groupman_authroles'),
]
operations = [
migrations.RunPython(forward, reverse),
]