Skip to content

Commit 7c3a4ce

Browse files
committed
Only show groups in reasonable states when showing current chartering efforts (otherwise crufty charter states can would lead to abandoned or replaced groups showing here). Fixes ietf-tools#2872. Commit ready for merge.
- Legacy-Id: 17246
1 parent a48dab3 commit 7c3a4ce

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

ietf/group/tests_info.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ def test_chartering_groups(self):
180180
self.assertContains(r, "Charter new RG")
181181
self.assertNotContains(r, "Charter new WG")
182182

183+
self.client.logout()
184+
replaced_group = CharterFactory(group__state_id='replaced',group__type_id='wg',group__parent=GroupFactory(type_id='area'),states=[('charter','intrev')]).group
185+
r = self.client.get(url)
186+
q = PyQuery(r.content)
187+
self.assertEqual(len(q('#content a:contains("%s")' % replaced_group.acronym)), 0)
183188

184189
def test_concluded_groups(self):
185190
group = GroupFactory(state_id='conclude')

ietf/group/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def chartering_groups(request):
401401
group_types = GroupTypeName.objects.filter(slug__in=group_type_slugs)
402402

403403
for t in group_types:
404-
t.chartering_groups = Group.objects.filter(type=t, charter__states__in=charter_states).select_related("state", "charter").order_by("acronym")
404+
t.chartering_groups = Group.objects.filter(type=t, charter__states__in=charter_states,state_id__in=('active','bof','proposed','dormant')).select_related("state", "charter").order_by("acronym")
405405
t.can_manage = can_manage_group_type(request.user, None, t.slug)
406406

407407
for g in t.chartering_groups:

0 commit comments

Comments
 (0)