X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6d42bc478e3d1bd90eb294464748c21e4de0fc63..94ca8037f9a5891b7ded1c92c639e0fbc676e67b:/src/newsletter/forms.py diff --git a/src/newsletter/forms.py b/src/newsletter/forms.py index 1091ed8c2..b75b7c6a9 100644 --- a/src/newsletter/forms.py +++ b/src/newsletter/forms.py @@ -21,6 +21,7 @@ class NewsletterForm(Form): required=False, initial=False, label=_('I want to receive Wolne Lektury\'s newsletter.')) mailing = False mailing_field = 'agree_newsletter' + mailing_list = 'general' data_processing_part1 = '''\ Administratorem danych osobowych jest Fundacja Nowoczesna Polska (ul. Marszałkowska 84/92 lok. 125, 00-514 Warszawa). @@ -52,7 +53,7 @@ Więcej informacji w polityce prywatności.''' # send_noreply_mail( # ugettext('Confirm your subscription to Wolne Lektury newsletter'), # render_to_string('newsletter/subscribe_email.html', {'subscription': subscription}), [email]) - mailing.subscribe(email, mailing_lists=self.cleaned_data.get('mailing_lists')) + mailing.subscribe(email, mailing_lists=[self.mailing_list]) class SubscribeForm(NewsletterForm): @@ -60,12 +61,9 @@ class SubscribeForm(NewsletterForm): agree_newsletter = None email = EmailField(label=_('email address')) - mailing_lists = MultipleChoiceField( - widget=CheckboxSelectMultiple, - choices=(('general', _('general newsletter')), ('contest', _('about the contest'))), - label=_('mailing list')) - def __init__(self, *args, **kwargs): + def __init__(self, mailing_list, *args, **kwargs): + self.mailing_list = mailing_list super(SubscribeForm, self).__init__(*args, **kwargs)