X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6d42bc478e3d1bd90eb294464748c21e4de0fc63..623676b97cc93293eff63398c7deb45cdec76af9:/src/newsletter/views.py?ds=sidebyside 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, })