Skip to content

Commit e8a59ce

Browse files
committed
Rewrote the submission deduce_group() to consider all groups with acronyms that are also GroupTypeNames. Added GroupTypeName for iesg,ise,adhoc groups, and appropriate GroupFeatures for each. Updated the names.json fixture.
- Legacy-Id: 15960
1 parent ccb9074 commit e8a59ce

4 files changed

Lines changed: 317 additions & 31 deletions

File tree

ietf/bin/generate-wg-aliases

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import debug # pyflakes:ignore
3434

3535
from ietf.group.models import Group
3636
from ietf.group.utils import get_group_ad_emails, get_group_role_emails, get_child_group_role_emails
37+
from ietf.name.models import GroupTypeName
3738
from ietf.utils.aliases import dump_sublist
3839

3940
# from secr/utils/group.py..
@@ -82,20 +83,16 @@ if __name__ == '__main__':
8283

8384
# - Research groups -----------------------------------------
8485
rgs = Group.objects.filter(type='rg').all()
85-
debug.pprint('rgs')
86-
86+
8787
# - status = Active
8888
active_rgs = rgs.filter(state__in=ACTIVE_STATES)
89-
debug.pprint('active_rgs')
9089

9190
# - activity within last year? (use concluded_date)
9291
inactive_recent_rgs = rgs.exclude(state__in=ACTIVE_STATES).filter(time__gte=show_since)
9392
interesting_rgs = active_rgs | inactive_recent_rgs
94-
debug.pprint('interesting_rgs')
9593

9694
for rg in interesting_rgs.distinct().iterator():
9795
name = rg.acronym
98-
debug.show('rg.acronym')
9996
#dump_sublist('%s%s' % (name, '-ads'), get_group_ad_emails, rg, True)
10097
dump_sublist(afile, vfile, name+'-chairs', ['ietf.org', 'irtf.org', ], settings.GROUP_VIRTUAL_DOMAIN, get_group_role_emails(rg, ['chair', 'secr']))
10198

@@ -115,7 +112,7 @@ if __name__ == '__main__':
115112
dump_sublist(afile, vfile, name+'-chairs', ['ietf.org', ], settings.GROUP_VIRTUAL_DOMAIN, get_group_role_emails(directorate, ['chair', 'secr']))
116113

117114
# - Areas --------------------------------------------------
118-
# Additionally, for areaz, we should list -ads and -chairs
115+
# Additionally, for areas, we should list -ads and -chairs
119116
# (for every chair in active groups within the area).
120117
areas = Group.objects.filter(type='area').all()
121118
active_areas = areas.filter(state__in=ACTIVE_STATES)
@@ -125,3 +122,13 @@ if __name__ == '__main__':
125122
dump_sublist(afile, vfile, name+'-ads' , ['ietf.org', ], settings.GROUP_VIRTUAL_DOMAIN, area_ad_emails)
126123
dump_sublist(afile, vfile, name+'-chairs', ['ietf.org', ], settings.GROUP_VIRTUAL_DOMAIN, (get_child_group_role_emails(area, ['chair', 'secr']) | area_ad_emails))
127124

125+
126+
# - Special groups --------------------------------------------------
127+
# We need to be able to send mail to chairs of groups that require
128+
# group draft submission approval and don't otherwise have aliases
129+
gtypes = GroupTypeName.objects.values_list('slug', flat=True)
130+
special_groups = Group.objects.filter(type__features__req_subm_approval=True, acronym__in=gtypes, state='active')
131+
for group in special_groups:
132+
dump_sublist(afile, vfile, group.acronym+'-chairs', ['ietf.org', ], settings.GROUP_VIRTUAL_DOMAIN, get_group_role_emails(group, ['chair', 'delegate']))
133+
134+
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# Copyright The IETF Trust 2019, All Rights Reserved
2+
# -*- coding: utf-8 -*-
3+
# Generated by Django 1.11.16 on 2019-01-09 09:02
4+
from __future__ import unicode_literals
5+
6+
7+
from django.db import migrations
8+
9+
import debug # pyflakes:ignore
10+
11+
#
12+
13+
14+
group_type_features = {
15+
'adhoc': {
16+
'grouptypename': {
17+
"slug": 'adhoc',
18+
"desc": 'Ad Hoc schedulable Group Type, for instance HotRfc',
19+
"name": "Ad Hoc",
20+
"order": 0,
21+
"used": True,
22+
"verbose_name": "Ad Hoc Group Type",
23+
},
24+
'groupfeatures': {
25+
'about_page': 'ietf.group.views.group_about',
26+
'acts_like_wg': False,
27+
'admin_roles': '["chair"]',
28+
'agenda_type_id': 'ietf',
29+
'create_wiki': True,
30+
'custom_group_roles': False,
31+
'customize_workflow': False,
32+
'default_tab': 'ietf.group.views.group_about',
33+
'docman_roles': '["chair"]',
34+
'groupman_roles': '["chair","delegate"]',
35+
'has_chartering_process': False,
36+
'has_default_jabber': True,
37+
'has_documents': False,
38+
'has_meetings': True,
39+
'has_milestones': False,
40+
'has_nonsession_materials': False,
41+
'has_reviews': False,
42+
'has_session_materials': True,
43+
'is_schedulable': True,
44+
'material_types': '["slides"]',
45+
'matman_roles': '["chair","delegate"]',
46+
'req_subm_approval': True,
47+
'role_order': '["chair","delegate"]',
48+
'show_on_agenda': True,
49+
},
50+
},
51+
'iesg': {
52+
'grouptypename': {
53+
"slug": 'iesg',
54+
"desc": '',
55+
"name": "IESG",
56+
"order": 0,
57+
"used": True,
58+
"verbose_name": "Internet Engineering Steering Group"
59+
},
60+
'groupfeatures': {
61+
'about_page': 'ietf.group.views.group_about',
62+
'acts_like_wg': False,
63+
'admin_roles': '["chair"]',
64+
'agenda_type_id': None,
65+
'create_wiki': False,
66+
'custom_group_roles': True,
67+
'customize_workflow': False,
68+
'default_tab': 'ietf.group.views.group_about',
69+
'docman_roles': '["chair"]',
70+
'groupman_roles': '["chair","delegate"]',
71+
'has_chartering_process': False,
72+
'has_default_jabber': False,
73+
'has_documents': False,
74+
'has_meetings': False,
75+
'has_milestones': False,
76+
'has_nonsession_materials': False,
77+
'has_reviews': False,
78+
'has_session_materials': False,
79+
'is_schedulable': False,
80+
'material_types': '[]',
81+
'matman_roles': '["chair","delegate"]',
82+
'req_subm_approval': True,
83+
'role_order': '["chair","secr"]',
84+
'show_on_agenda': False
85+
},
86+
},
87+
'ise': {
88+
'grouptypename': {
89+
"slug": 'ise',
90+
"desc": '',
91+
"name": "ISE",
92+
"order": 0,
93+
"used": True,
94+
"verbose_name": "Independent Stream Editor",
95+
},
96+
'groupfeatures': {
97+
'about_page': 'ietf.group.views.group_about',
98+
'acts_like_wg': False,
99+
'admin_roles': '["chair","lead"]',
100+
'agenda_type_id': None,
101+
'create_wiki': False,
102+
'custom_group_roles': True,
103+
'customize_workflow': False,
104+
'default_tab': 'ietf.group.views.group_about',
105+
'docman_roles': '["chair"]',
106+
'groupman_roles': '["chair","delegate"]',
107+
'has_chartering_process': False,
108+
'has_default_jabber': False,
109+
'has_documents': False,
110+
'has_meetings': False,
111+
'has_milestones': False,
112+
'has_nonsession_materials': False,
113+
'has_reviews': False,
114+
'has_session_materials': False,
115+
'is_schedulable': False,
116+
'material_types': '[]',
117+
'matman_roles': '["chair","delegate"]',
118+
'req_subm_approval': True,
119+
'role_order': '["chair"]',
120+
'show_on_agenda': False
121+
},
122+
},
123+
}
124+
125+
def forward(apps, schema_editor):
126+
GroupTypeName = apps.get_model('name', 'GroupTypeName')
127+
GroupFeatures = apps.get_model('group', 'GroupFeatures')
128+
for slug in group_type_features:
129+
typename = group_type_features[slug]['grouptypename']
130+
gt, _ = GroupTypeName.objects.get_or_create(slug=slug)
131+
for k,v in typename.items():
132+
setattr(gt, k, v)
133+
gt.save()
134+
#
135+
features = group_type_features[slug]['groupfeatures']
136+
gf, _ = GroupFeatures.objects.get_or_create(type_id=slug)
137+
for k,v in features.items():
138+
setattr(gf, k, v)
139+
gf.save()
140+
141+
142+
# This migration does not remove or change any previous fields, and executes
143+
# swirftly, so we permit it to be interleaved with schema migrations
144+
forward.interleavable = True
145+
146+
def reverse(apps, schema_editor):
147+
pass
148+
149+
class Migration(migrations.Migration):
150+
151+
dependencies = [
152+
('group', '0010_remove_groupfeatures_has_dependencies')
153+
]
154+
155+
operations = [
156+
migrations.RunPython(forward, reverse),
157+
]

0 commit comments

Comments
 (0)