Skip to content

Commit 2f4b493

Browse files
authored
fix: Don't show To Subscribe on group about when there's no url to subscribe with. Fixes ietf-tools#4022. (ietf-tools#4023)
1 parent 6094645 commit 2f4b493

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

ietf/group/tests_info.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,17 @@ def test_group_about_personnel(self):
351351
for role in group.role_set.all():
352352
self.assertContains(r, escape(role.person.name))
353353

354+
def test_group_about_nosubscribe(self):
355+
group = GroupFactory()
356+
self.assertEqual(group.list_subscribe, '')
357+
url = urlreverse('ietf.group.views.group_about', kwargs=dict(acronym=group.acronym))
358+
r = self.client.get(url)
359+
self.assertNotContains(r,'To subscribe')
360+
group.list_subscribe='foo@example.com'
361+
group.save()
362+
r = self.client.get(url)
363+
self.assertContains(r,'To subscribe')
364+
354365
def test_materials(self):
355366
group = GroupFactory(type_id="team", acronym="testteam", name="Test Team", state_id="active")
356367

ietf/templates/group/group_about.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@
215215
{{ group.list_email|linkify }}
216216
</td>
217217
</tr>
218+
{% if group.list_subscribe %}
218219
<tr>
219220
<td>
220221
</td>
@@ -233,6 +234,7 @@
233234
{{ group.list_subscribe|linkify }}
234235
</td>
235236
</tr>
237+
{% endif %}
236238
<tr>
237239
<td>
238240
</td>

0 commit comments

Comments
 (0)