Mark Sapiro wrote:
>
> I think it would be nice if we had a configuration setting to do that.
Here's a patch that enables setting
```
SHOW_ANONYMOUS_SUBSCRIBE_FORM = False
```
in your Django settings to suppress the anonymous subscribe form.
--
Mark Sapiro <m...@msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
diff --git a/src/postorius/templates/postorius/lists/summary.html
b/src/postorius/templates/postorius/lists/summary.html
index 6bc47b39..978a0b20 100644
--- a/src/postorius/templates/postorius/lists/summary.html
+++ b/src/postorius/templates/postorius/lists/summary.html
@@ -109,20 +109,22 @@
{% endblocktrans %}</p>
<p><a href="{% url LOGIN_URL %}?next={{
next|default:request.path|urlencode }}" class="btn btn-primary">{% trans 'Log
In' %}</a></p>
</div>
- <hr />
- <div>
- <p>
- {% blocktrans %}
- You can also subscribe without creating an account.
- If you wish to do so, please use the form below.
- {% endblocktrans%}
- </p>
- <form action="{% url 'list_anonymous_subscribe' list.list_id %}"
- method="post" class="form-horizontal">
- {% bootstrap_form_horizontal anonymous_subscription_form 2 8
'Subscribe' %}
- <p hidden>{% trans 'Subscribe' %}</p>
- </form>
- </div>
+ {% if anon_subscribe %}
+ <hr />
+ <div>
+ <p>
+ {% blocktrans %}
+ You can also subscribe without creating an account.
+ If you wish to do so, please use the form below.
+ {% endblocktrans%}
+ </p>
+ <form action="{% url 'list_anonymous_subscribe' list.list_id %}"
+ method="post" class="form-horizontal">
+ {% bootstrap_form_horizontal anonymous_subscription_form 2 8
'Subscribe' %}
+ <p hidden>{% trans 'Subscribe' %}</p>
+ </form>
+ </div>
+ {% endif %}
{% endif %}
{# List metrics #}
diff --git a/src/postorius/views/list.py b/src/postorius/views/list.py
index 8e6f3b39..a641b721 100644
--- a/src/postorius/views/list.py
+++ b/src/postorius/views/list.py
@@ -340,6 +340,9 @@ class ListSummaryView(MailingListView):
'subscribed_preferred': False,
'public_archive': False,
'hyperkitty_enabled': False,
+ 'anon_subscribe': getattr(
+ settings, 'SHOW_ANONYMOUS_SUBSCRIBE_FORM', True
+ ),
}
if self.mailing_list.settings['archive_policy'] == 'public':
data['public_archive'] = True
_______________________________________________
Mailman-Developers mailing list -- mailman-developers@python.org
To unsubscribe send an email to mailman-developers-le...@python.org
https://mail.python.org/mailman3/lists/mailman-developers.python.org/
Mailman FAQ: https://wiki.list.org/x/AgA3
Security Policy: https://wiki.list.org/x/QIA9