diff --git a/ietf/community/tests.py b/ietf/community/tests.py index d76347b70a..84e4370771 100644 --- a/ietf/community/tests.py +++ b/ietf/community/tests.py @@ -108,10 +108,8 @@ def email_or_name_set(self, person): return [e for e in Email.objects.filter(person=person)] + \ [a for a in Alias.objects.filter(person=person)] - def test_view_list(self): - person = self.complex_person(user__username='plain') + def do_view_list_test(self, person): draft = WgDraftFactory() - # without list for id in self.email_or_name_set(person): url = urlreverse(ietf.community.views.view_list, kwargs={ "email_or_name": id }) @@ -134,6 +132,15 @@ def test_view_list(self): self.assertEqual(r.status_code, 200, msg=f"id='{id}', url='{url}'") self.assertContains(r, draft.name) + def test_view_list(self): + person = self.complex_person(user__username='plain') + self.do_view_list_test(person) + + def test_view_list_without_active_email(self): + person = self.complex_person(user__username='plain') + person.email_set.update(active=False) + self.do_view_list_test(person) + def test_manage_personal_list(self): person = self.complex_person(user__username='plain') ad = Person.objects.get(user__username='ad') diff --git a/ietf/community/views.py b/ietf/community/views.py index 4a28a391f0..78b8144d60 100644 --- a/ietf/community/views.py +++ b/ietf/community/views.py @@ -68,6 +68,7 @@ def view_list(request, email_or_name=None): 'meta': meta, 'can_manage_list': can_manage_community_list(request.user, clist), 'subscribed': subscribed, + "email_or_name": email_or_name, }) @login_required diff --git a/ietf/templates/community/list_menu.html b/ietf/templates/community/list_menu.html index 0552c76a45..009d01152d 100644 --- a/ietf/templates/community/list_menu.html +++ b/ietf/templates/community/list_menu.html @@ -3,18 +3,18 @@