Fixes #4075: overflow in book box in html.
[wolnelektury.git] / src / newsletter / views.py
index 4c57a25..6c90873 100644 (file)
@@ -11,16 +11,16 @@ from newsletter.forms import UnsubscribeForm, SubscribeForm
 from newsletter.models import Subscription
 
 
 from newsletter.models import Subscription
 
 
-def subscribe_form(request):
+def subscribe_form(request, mailing_list='general', title=None):
     if request.POST:
     if request.POST:
-        form = SubscribeForm(request.POST)
+        form = SubscribeForm(mailing_list, request.POST)
         if form.is_valid():
             form.save()
             return HttpResponseRedirect(reverse('subscribed'))
     else:
         if form.is_valid():
             form.save()
             return HttpResponseRedirect(reverse('subscribed'))
     else:
-        form = SubscribeForm()
+        form = SubscribeForm(mailing_list)
     return render(request, 'newsletter/subscribe_form.html', {
     return render(request, 'newsletter/subscribe_form.html', {
-        'page_title': _('Subscribe To Newsletter'),
+        'page_title': title or _('Subscribe To Newsletter'),
         'form': form,
     })
 
         'form': form,
     })