mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-13 13:12:42 +00:00
Remove majordomo2 subscription form
Replace it with a redirect to lists.postgresql.org, where pglister lives.
This commit is contained in:
@ -1,10 +1,2 @@
|
||||
from django import forms
|
||||
|
||||
from models import MailingList
|
||||
|
||||
class SubscribeForm(forms.Form):
|
||||
jquery = True
|
||||
|
||||
email = forms.EmailField(max_length=100,required=True,label="Email address")
|
||||
action = forms.ChoiceField(required=True, choices=(('subscribe','Subscribe'),('unsubscribe','Unsubscribe')))
|
||||
lists = forms.ModelChoiceField(required=True, queryset=MailingList.objects.filter(active=True), label="Mailinglist")
|
||||
|
@ -1,3 +1,2 @@
|
||||
def get_struct():
|
||||
yield ('community/lists/', None)
|
||||
yield ('community/lists/subscribe/', None)
|
||||
|
@ -5,50 +5,7 @@ from django.conf import settings
|
||||
|
||||
import json
|
||||
|
||||
from pgweb.util.contexts import NavContext
|
||||
from pgweb.mailqueue.util import send_simple_mail
|
||||
|
||||
from models import MailingList, MailingListGroup
|
||||
from forms import SubscribeForm
|
||||
|
||||
@csrf_exempt
|
||||
def subscribe(request):
|
||||
if request.POST:
|
||||
form = SubscribeForm(request.POST)
|
||||
if form.is_valid():
|
||||
if form.cleaned_data['action'] == 'subscribe':
|
||||
mailsubject = "subscribe"
|
||||
# We currently only support get mail, no digest.
|
||||
# So send a regular subscribe request.
|
||||
mailtxt = "subscribe %s\n" % form.cleaned_data['lists']
|
||||
else:
|
||||
mailtxt = "unsubscribe %s\n" % form.cleaned_data['lists']
|
||||
mailsubject = "unsubscribe"
|
||||
|
||||
send_simple_mail(form.cleaned_data['email'],
|
||||
settings.LISTSERVER_EMAIL,
|
||||
mailsubject,
|
||||
mailtxt)
|
||||
|
||||
return render_to_response('lists/subscribed.html', {
|
||||
}, NavContext(request, "community"))
|
||||
else:
|
||||
# GET, so render up the form
|
||||
form = SubscribeForm()
|
||||
|
||||
return render_to_response('lists/subscribe_form.html', {
|
||||
'form': form,
|
||||
'operation': 'Legacy subscription',
|
||||
'jquery': True,
|
||||
'form_intro': """
|
||||
<b>Note 1:</b> Please ensure you read the <a
|
||||
href="https://wiki.postgresql.org/wiki/Archives_Policy">Archive Policy</a>
|
||||
before posting to the lists.</p>
|
||||
|
||||
<p><b>Note 2:</b> Please do not subscribe to mailing lists using e-mail
|
||||
accounts protected by mail-back anti-spam systems. These are extremely annoying
|
||||
to the list maintainers and other members, and you may be automatically unsubscribed."""
|
||||
}, NavContext(request, "community"))
|
||||
|
||||
def listinfo(request):
|
||||
resp = HttpResponse(content_type='application/json')
|
||||
|
@ -146,7 +146,6 @@ STATIC_CHECKOUT="/usr/local/pgweb-static" # Location of a checked o
|
||||
NOTIFICATION_EMAIL="someone@example.com" # Address to send notifications *to*
|
||||
NOTIFICATION_FROM="someone@example.com" # Address to send notifications *from*
|
||||
NOREPLY_FROM="someone@example.com" # Address to send unverified messages from
|
||||
LISTSERVER_EMAIL="someone@example.com" # Address to majordomo
|
||||
BUGREPORT_EMAIL="someone@example.com" # Address to pgsql-bugs list
|
||||
BUGREPORT_NOREPLY_EMAIL="someone-noreply@example.com" # Address to no-reply pgsql-bugs address
|
||||
DOCSREPORT_EMAIL="someone@example.com" # Address to pgsql-docs list
|
||||
|
@ -49,7 +49,8 @@ urlpatterns = patterns('',
|
||||
(r'^community/$', 'pgweb.core.views.community'),
|
||||
(r'^community/contributors/$', 'pgweb.contributors.views.completelist'),
|
||||
(r'^community/lists/$', RedirectView.as_view(url='/list/', permanent=True)),
|
||||
(r'^community/lists/subscribe/$', 'pgweb.lists.views.subscribe'),
|
||||
(r'^community/lists/subscribe/$', RedirectView.as_view(url='https://lists.postgresql.org/', permanent=True)),
|
||||
|
||||
(r'^community/lists/listinfo/$', 'pgweb.lists.views.listinfo'),
|
||||
(r'^community/lists/activate/$', 'pgweb.lists.views.activate'),
|
||||
(r'^community/survey/vote/(\d+)/$', 'pgweb.survey.views.vote'),
|
||||
|
@ -1,28 +0,0 @@
|
||||
{%extends "base/form.html"%}
|
||||
{% block extrahead %}
|
||||
{{ block.super }}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var part = document.URL.substring(document.URL.indexOf('#')+1);
|
||||
$('#id_lists').val(part);
|
||||
});
|
||||
</script>
|
||||
{%endblock%}
|
||||
{%block pre_form_header%}
|
||||
<h1>Subscribe</h1>
|
||||
<p>
|
||||
The PostgreSQL project is currently migrating all mailinglists from an
|
||||
old legacy system to a new more modern system. As this migration goes
|
||||
on, there will unfortunately be two different sets of subscribe and
|
||||
unsubscribe methods.
|
||||
</p>
|
||||
<p>
|
||||
To subscribe to one of the lists that have been migrated, please use
|
||||
the <a href="https://lists.postgresql.org/manage/">new system</a>.
|
||||
</p>
|
||||
<p>
|
||||
If the list you want to subscribe to is listed below, it has not yet
|
||||
been migrated. For these lists, please use the form below. Use the
|
||||
same form to unsubscribe from one of these lists.
|
||||
</p>
|
||||
{%endblock%}
|
Reference in New Issue
Block a user