Skip to content

Commit 2b10465

Browse files
committed
Convert IRTF area groups into their own group type rather than attempting to overload AG. Fixes ietf-tools#3027. Commit ready for merge.
- Legacy-Id: 18298
1 parent 44d19f0 commit 2b10465

27 files changed

Lines changed: 15029 additions & 14925 deletions

File tree

ietf/bin/list-role-holder-emails

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ from ietf.group.models import Role
2424
addresses = set()
2525
for role in Role.objects.filter(
2626
group__state__slug='active',
27-
group__type__in=['ag','area','dir','iab','ietf','irtf','nomcom','rg','team','wg',]):
27+
group__type__in=['ag','area','dir','iab','ietf','irtf','nomcom','rg','team','wg','rag']):
2828
#sys.stderr.write(str(role)+'\n')
2929
for e in role.person.email_set.all():
3030
if e.active and not e.address.startswith('unknown-email-'):

ietf/community/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def restrict_state(state_type, slug=None):
4545
self.fields["group"].label = "Area"
4646
self.fields["group"].queryset = self.fields["group"].queryset.filter(Q(type="area") | Q(acronym="irtf")).order_by("acronym")
4747
else:
48-
self.fields["group"].queryset = self.fields["group"].queryset.filter(type__in=("wg", "rg", "ag", )).order_by("acronym")
48+
self.fields["group"].queryset = self.fields["group"].queryset.filter(type__in=("wg", "rg", "ag", "rag", "program" )).order_by("acronym")
4949

5050
del self.fields["person"]
5151
del self.fields["text"]

ietf/community/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def can_manage_community_list(user, clist):
5151
if has_role(user, 'Secretariat'):
5252
return True
5353

54-
if clist.group.type_id in ['area', 'wg', 'rg', 'ag', 'program', ]:
54+
if clist.group.type_id in ['area', 'wg', 'rg', 'ag', 'rag', 'program', ]:
5555
return Role.objects.filter(name__slug__in=clist.group.features.groupman_roles, person__user=user, group=clist.group).exists()
5656

5757
return False

ietf/doc/mails.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def generate_approval_mail_approved(request, doc):
246246

247247
# the second check catches some area working groups (like
248248
# Transport Area Working Group)
249-
if doc.group.type_id not in ("area", "individ", "ag", "rg") and not doc.group.name.endswith("Working Group"):
249+
if doc.group.type_id not in ("area", "individ", "ag", "rg", "rag") and not doc.group.name.endswith("Working Group"):
250250
doc.group.name_with_wg = doc.group.name + " Working Group"
251251
else:
252252
doc.group.name_with_wg = doc.group.name

ietf/doc/templatetags/active_groups_menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
register = template.Library()
99

10-
parents = GroupTypeName.objects.filter(slug__in=['ag','area','team','dir','program'])
10+
parents = GroupTypeName.objects.filter(slug__in=['ag','area','rag','team','dir','program'])
1111

1212
others = []
1313
for group in Group.objects.filter(acronym__in=('rsoc',), state_id='active'):

ietf/doc/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def can_adopt_draft(user, doc):
121121
and doc.group.type_id == "individ")
122122

123123
roles = Role.objects.filter(name__in=("chair", "delegate", "secr"),
124-
group__type__in=("wg", "rg", "ag", ),
124+
group__type__in=("wg", "rg", "ag", "rag"),
125125
group__state="active",
126126
person__user=user)
127127
role_groups = [ r.group for r in roles ]

ietf/group/factories.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Meta:
2222
def parent(self):
2323
if self.type_id in ['wg','ag']:
2424
return GroupFactory(type_id='area')
25-
elif self.type_id in ['rg']:
25+
elif self.type_id in ['rg','rag']:
2626
return GroupFactory(acronym='irtf', type_id='irtf')
2727
else:
2828
return None

ietf/group/tests_info.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_active_groups(self):
7171
self.assertContains(r, group.name)
7272
self.assertContains(r, group.ad_role().person.plain_name())
7373

74-
for t in ('rg','area','ag','dir','review','team','program'):
74+
for t in ('rg','area','ag', 'rag', 'dir','review','team','program'):
7575
g = GroupFactory.create(type_id=t,state_id='active')
7676
if t in ['dir','review']:
7777
g.parent = GroupFactory.create(type_id='area',state_id='active')
@@ -87,7 +87,7 @@ def test_active_groups(self):
8787
self.assertContains(r, "Directorate")
8888
self.assertContains(r, "AG")
8989

90-
for slug in GroupTypeName.objects.exclude(slug__in=['wg','rg','ag','area','dir','review','team','program','adhoc','ise']).values_list('slug',flat=True):
90+
for slug in GroupTypeName.objects.exclude(slug__in=['wg','rg','ag','rag','area','dir','review','team','program','adhoc','ise']).values_list('slug',flat=True):
9191
with self.assertRaises(NoReverseMatch):
9292
url=urlreverse('ietf.group.views.active_groups', kwargs=dict(group_type=slug))
9393

@@ -265,6 +265,7 @@ def test_group_about(self):
265265
'wg' : ['secretary','ad'],
266266
'rg' : ['secretary','irtf-chair'],
267267
'ag' : ['secretary', 'ad' ],
268+
'rag' : ['secretary', 'irtf-chair'],
268269
'team' : ['secretary',], # The code currently doesn't let ads edit teams or directorates. Maybe it should.
269270
'dir' : ['secretary',],
270271
'review' : ['secretary',],
@@ -279,7 +280,7 @@ def setup_role(group, role_id):
279280

280281
test_groups = []
281282

282-
for t in ['wg','rg','ag','team']:
283+
for t in ['wg','rg','ag','rag','team']:
283284
g = GroupFactory(type_id=t)
284285
setup_role(g,'chair')
285286
test_groups.append(g)
@@ -1472,7 +1473,7 @@ def ensure_cant_edit(group,user):
14721473
self.assertEqual(response.status_code, 404)
14731474
self.client.logout()
14741475

1475-
for type_id in GroupTypeName.objects.exclude(slug__in=('wg','rg','ag','team')).values_list('slug',flat=True):
1476+
for type_id in GroupTypeName.objects.exclude(slug__in=('wg','rg','ag','rag','team')).values_list('slug',flat=True):
14761477
group = GroupFactory.create(type_id=type_id)
14771478
for user in (None,User.objects.get(username='secretary')):
14781479
ensure_updates_dont_show(group,user)

ietf/group/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def construct_group_menu_context(request, group, selected, group_type, others):
216216
entries.append(("Review requests", urlreverse(ietf.group.views.review_requests, kwargs=kwargs)))
217217
entries.append(("Reviewers", urlreverse(ietf.group.views.reviewer_overview, kwargs=kwargs)))
218218

219-
if group.features.has_meetings: # type_id in ('rg','wg','ag','team'):
219+
if group.features.has_meetings:
220220
entries.append(("Meetings", urlreverse("ietf.group.views.meetings", kwargs=kwargs)))
221221
entries.append(("History", urlreverse("ietf.group.views.history", kwargs=kwargs)))
222222
entries.append(("Photos", urlreverse("ietf.group.views.group_photos", kwargs=kwargs)))

ietf/group/views.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ def active_groups(request, group_type=None):
289289
return active_rgs(request)
290290
elif group_type == "ag":
291291
return active_ags(request)
292+
elif group_type == "rag":
293+
return active_rags(request)
292294
elif group_type == "area":
293295
return active_areas(request)
294296
elif group_type == "team":
@@ -303,7 +305,7 @@ def active_groups(request, group_type=None):
303305
raise Http404
304306

305307
def active_group_types(request):
306-
grouptypes = GroupTypeName.objects.filter(slug__in=['wg','rg','ag','team','dir','review','area','program']).filter(group__state='active').annotate(group_count=Count('group'))
308+
grouptypes = GroupTypeName.objects.filter(slug__in=['wg','rg','ag','rag','team','dir','review','area','program']).filter(group__state='active').annotate(group_count=Count('group'))
307309
return render(request, 'group/active_groups.html', {'grouptypes':grouptypes})
308310

309311
def active_dirs(request):
@@ -378,6 +380,14 @@ def active_ags(request):
378380
group.ads = sorted(roles(group, "ad"), key=extract_last_name)
379381

380382
return render(request, 'group/active_ags.html', { 'groups': groups })
383+
384+
def active_rags(request):
385+
386+
groups = Group.objects.filter(type="rag", state="active").order_by("acronym")
387+
for group in groups:
388+
group.chairs = sorted(roles(group, "chair"), key=extract_last_name)
389+
390+
return render(request, 'group/active_rags.html', { 'groups': groups })
381391

382392
def bofs(request, group_type):
383393
groups = Group.objects.filter(type=group_type, state="bof")
@@ -408,6 +418,7 @@ def concluded_groups(request):
408418
sections['RGs'] = Group.objects.filter(type='rg', state="conclude").select_related("state", "charter").order_by("parent__name","acronym")
409419
sections['BOFs'] = Group.objects.filter(type='wg', state="bof-conc").select_related("state", "charter").order_by("parent__name","acronym")
410420
sections['AGs'] = Group.objects.filter(type='ag', state="conclude").select_related("state", "charter").order_by("parent__name","acronym")
421+
sections['RAGs'] = Group.objects.filter(type='rag', state="conclude").select_related("state", "charter").order_by("parent__name","acronym")
411422
sections['Directorates'] = Group.objects.filter(type='dir', state="conclude").select_related("state", "charter").order_by("parent__name","acronym")
412423
sections['Review teams'] = Group.objects.filter(type='review', state="conclude").select_related("state", "charter").order_by("parent__name","acronym")
413424
sections['Teams'] = Group.objects.filter(type='team', state="conclude").select_related("state", "charter").order_by("parent__name","acronym")

0 commit comments

Comments
 (0)