Skip to content

Commit 2c92aa2

Browse files
committed
Treat Area Groups similar to Working Groups and Research Groups where it makes sense to do so. Commit ready for merge.
- Legacy-Id: 13832
1 parent 68d70aa commit 2c92aa2

19 files changed

Lines changed: 23 additions & 17 deletions

File tree

ietf/community/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def restrict_state(state_type, slug=None):
3939
self.fields["group"].label = "Area"
4040
self.fields["group"].queryset = self.fields["group"].queryset.filter(Q(type="area") | Q(acronym="irtf")).order_by("acronym")
4141
else:
42-
self.fields["group"].queryset = self.fields["group"].queryset.filter(type__in=("wg", "rg")).order_by("acronym")
42+
self.fields["group"].queryset = self.fields["group"].queryset.filter(type__in=("wg", "rg", "ag", )).order_by("acronym")
4343

4444
del self.fields["person"]
4545
del self.fields["text"]

ietf/community/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def can_manage_community_list(user, clist):
4747

4848
if clist.group.type_id == 'area':
4949
return Role.objects.filter(name__slug='ad', person__user=user, group=clist.group).exists()
50-
elif clist.group.type_id in ('wg', 'rg'):
50+
elif clist.group.type_id in ('wg', 'rg', 'ag'):
5151
return Role.objects.filter(name__slug='chair', person__user=user, group=clist.group).exists()
5252
elif clist.group.type_id in ('program'):
5353
return Role.objects.filter(name__slug='lead', person__user=user, group=clist.group).exists()

ietf/doc/utils.py

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

109109
roles = Role.objects.filter(name__in=("chair", "delegate", "secr"),
110-
group__type__in=("wg", "rg"),
110+
group__type__in=("wg", "rg", "ag", ),
111111
group__state="active",
112112
person__user=user)
113113
role_groups = [ r.group for r in roles ]

ietf/group/features.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class GroupFeatures(object):
1616
admin_roles = ["chair"]
1717

1818
def __init__(self, group):
19+
# TODO: should 'ag' be in this list
1920
if group.type_id in ("wg", "rg"):
2021
self.has_milestones = True
2122
self.has_chartering_process = True

ietf/group/forms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def insert_confirm_field(label, initial):
155155
if existing:
156156
raise forms.ValidationError("Acronym used for an existing group (%s)." % existing.name)
157157

158+
# TODO: Why is this limited to types wg and rg? We would want to be warned about _any_ old collision I think?
158159
old = GroupHistory.objects.filter(acronym__iexact=acronym, type__in=("wg", "rg"))
159160
if old:
160161
insert_confirm_field(label="Confirm reusing acronym %s" % old[0].acronym, initial=False)

ietf/group/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __unicode__(self):
3737

3838
def name_with_acronym(self):
3939
res = self.name
40-
if self.type_id in ("wg", "rg", "area"):
40+
if self.type_id in ("wg", "rg", "ag", "area"):
4141
res += " %s (%s)" % (self.type, self.acronym)
4242
return res
4343

@@ -55,7 +55,7 @@ def about_url(self):
5555
# bridge gap between group-type prefixed URLs and /group/ ones
5656
from django.urls import reverse as urlreverse
5757
kwargs = { 'acronym': self.acronym }
58-
if self.type_id in ("wg", "rg"):
58+
if self.type_id in ("wg", "rg", "ag"):
5959
kwargs["group_type"] = self.type_id
6060
return urlreverse(self.features.about_page, kwargs=kwargs)
6161

ietf/group/tests_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ def ensure_cant_edit(group,user):
12181218
self.assertEqual(response.status_code, 404)
12191219
self.client.logout()
12201220

1221-
for type_id in GroupTypeName.objects.exclude(slug__in=('wg','rg','team')).values_list('slug',flat=True):
1221+
for type_id in GroupTypeName.objects.exclude(slug__in=('wg','rg','ag','team')).values_list('slug',flat=True):
12221222
group = GroupFactory.create(type_id=type_id)
12231223
for user in (None,User.objects.get(username='secretary')):
12241224
ensure_updates_dont_show(group,user)

ietf/group/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def can_manage_materials(user, group):
124124
return has_role(user, 'Secretariat') or group.has_role(user, ("chair", "delegate", "secr", "matman"))
125125

126126
def can_provide_status_update(user, group):
127-
if not group.type_id in ['wg','rg','team']:
127+
if not group.type_id in ['wg','rg','ag','team']:
128128
return False
129129
return has_role(user, 'Secretariat') or group.has_role(user, ("chair", "delegate", "secr", "ad",))
130130

@@ -181,7 +181,7 @@ def construct_group_menu_context(request, group, selected, group_type, others):
181181
import ietf.group.views
182182
entries.append(("Review requests", urlreverse(ietf.group.views.review_requests, kwargs=kwargs)))
183183
entries.append(("Reviewers", urlreverse(ietf.group.views.reviewer_overview, kwargs=kwargs)))
184-
if group.type_id in ('rg','wg','team'):
184+
if group.type_id in ('rg','wg','ag','team'):
185185
entries.append(("Meetings", urlreverse("ietf.group.views.meetings", kwargs=kwargs)))
186186
entries.append(("History", urlreverse("ietf.group.views.history", kwargs=kwargs)))
187187
entries.append(("Photos", urlreverse("ietf.group.views.group_photos", kwargs=kwargs)))

ietf/group/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ def group_photos(request, group_type=None, acronym=None):
767767
group = get_object_or_404(Group, acronym=acronym)
768768
roles = sorted(Role.objects.filter(group__acronym=acronym),key=lambda x: x.name.name+x.person.last_name())
769769

770-
if group.type_id in ['wg', 'rg', ]:
770+
if group.type_id in ['wg', 'rg', 'ag', ]:
771771
roles = reorder_roles(roles, ['chair', 'secr'])
772772
elif group.type_id in ['nomcom', ]:
773773
roles = reorder_roles(roles, ['chair', 'member', 'advisor', ])

ietf/mailinglists/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from django.shortcuts import render
55

66
def groups(request):
7-
groups = Group.objects.filter(type__in=("wg", "rg"), list_archive__startswith='http').order_by("acronym")
7+
groups = Group.objects.filter(type__in=("wg", "rg", "ag"), list_archive__startswith='http').order_by("acronym")
88

99
return render(request, "mailinglists/group_archives.html", { "groups": groups } )
1010

0 commit comments

Comments
 (0)