X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6d42bc478e3d1bd90eb294464748c21e4de0fc63..0be9e0edd734fe1b7f9f9fbb7103a88adfce4427:/src/newsletter/views.py?ds=inline diff --git a/src/newsletter/views.py b/src/newsletter/views.py index 4c57a251d..6c90873bb 100644 --- a/src/newsletter/views.py +++ b/src/newsletter/views.py @@ -11,16 +11,16 @@ from newsletter.forms import UnsubscribeForm, SubscribeForm from newsletter.models import Subscription -def subscribe_form(request): +def subscribe_form(request, mailing_list='general', title=None): if request.POST: - form = SubscribeForm(request.POST) + form = SubscribeForm(mailing_list, request.POST) if form.is_valid(): form.save() return HttpResponseRedirect(reverse('subscribed')) else: - form = SubscribeForm() + form = SubscribeForm(mailing_list) return render(request, 'newsletter/subscribe_form.html', { - 'page_title': _('Subscribe To Newsletter'), + 'page_title': title or _('Subscribe To Newsletter'), 'form': form, })