fix: Don't show To Subscribe on group about when there's no url to subscribe with. Fixes #4022. (#4023)

This commit is contained in:
Robert Sparks 2022-05-25 14:52:44 -05:00 committed by GitHub
parent 6094645e7a
commit 2f4b493575
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -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")

View file

@ -215,6 +215,7 @@
{{ group.list_email|linkify }}
</td>
</tr>
{% if group.list_subscribe %}
<tr>
<td>
</td>
@ -233,6 +234,7 @@
{{ group.list_subscribe|linkify }}
</td>
</tr>
{% endif %}
<tr>
<td>
</td>