From 2f4b493575112069e7b929097680997bbb20a2bf Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Wed, 25 May 2022 14:52:44 -0500 Subject: [PATCH] fix: Don't show To Subscribe on group about when there's no url to subscribe with. Fixes #4022. (#4023) --- ietf/group/tests_info.py | 11 +++++++++++ ietf/templates/group/group_about.html | 2 ++ 2 files changed, 13 insertions(+) diff --git a/ietf/group/tests_info.py b/ietf/group/tests_info.py index d015f270f..73007eeee 100644 --- a/ietf/group/tests_info.py +++ b/ietf/group/tests_info.py @@ -351,6 +351,17 @@ class GroupPagesTests(TestCase): for role in group.role_set.all(): self.assertContains(r, escape(role.person.name)) + def test_group_about_nosubscribe(self): + group = GroupFactory() + self.assertEqual(group.list_subscribe, '') + url = urlreverse('ietf.group.views.group_about', kwargs=dict(acronym=group.acronym)) + r = self.client.get(url) + self.assertNotContains(r,'To subscribe') + group.list_subscribe='foo@example.com' + group.save() + r = self.client.get(url) + self.assertContains(r,'To subscribe') + def test_materials(self): group = GroupFactory(type_id="team", acronym="testteam", name="Test Team", state_id="active") diff --git a/ietf/templates/group/group_about.html b/ietf/templates/group/group_about.html index 3bdd4da21..e9cb7931a 100644 --- a/ietf/templates/group/group_about.html +++ b/ietf/templates/group/group_about.html @@ -215,6 +215,7 @@ {{ group.list_email|linkify }} + {% if group.list_subscribe %} @@ -233,6 +234,7 @@ {{ group.list_subscribe|linkify }} + {% endif %}