fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Authors in collections
[wolnelektury.git]
/
src
/
newsletter
/
forms.py
diff --git
a/src/newsletter/forms.py
b/src/newsletter/forms.py
index
3f08668
..
16f216e
100644
(file)
--- a/
src/newsletter/forms.py
+++ b/
src/newsletter/forms.py
@@
-6,7
+6,7
@@
from django.core.validators import validate_email
from django.forms import Form, BooleanField
from django.forms.fields import EmailField
from django.utils.safestring import mark_safe
from django.forms import Form, BooleanField
from django.forms.fields import EmailField
from django.utils.safestring import mark_safe
-from django.utils.translation import
u
gettext_lazy as _
+from django.utils.translation import gettext_lazy as _
from newsletter.subscribe import subscribe
from .models import Newsletter
from newsletter.subscribe import subscribe
from .models import Newsletter
@@
-14,7
+14,7
@@
from .models import Newsletter
class NewsletterForm(Form):
email_field = 'email'
agree_newsletter = BooleanField(
class NewsletterForm(Form):
email_field = 'email'
agree_newsletter = BooleanField(
- required=False, initial=False, label=_('I want to receive Wolne Lektury\'s newsletter.'))
+ required=False, initial=False, label=_('I want to receive Wolne Lektury\'s newsletter.')
, label_suffix=False
)
mailing = False
mailing_field = 'agree_newsletter'
newsletter = None
mailing = False
mailing_field = 'agree_newsletter'
newsletter = None
@@
-25,8
+25,15
@@
Podanie danych osobowych jest dobrowolne.'''
data_processing_part2 = '''Dane są przetwarzane w zakresie niezbędnym do wysyłania newslettera odbiorcom.'''
data_processing_part3 = '''\
Osobom, których dane są zbierane, przysługuje prawo dostępu do treści swoich danych oraz ich poprawiania.
data_processing_part2 = '''Dane są przetwarzane w zakresie niezbędnym do wysyłania newslettera odbiorcom.'''
data_processing_part3 = '''\
Osobom, których dane są zbierane, przysługuje prawo dostępu do treści swoich danych oraz ich poprawiania.
-Więcej informacji w <a href="">polityce prywatności.</a>'''
+Więcej informacji w <a href="
https://nowoczesnapolska.org.pl/prywatnosc/
">polityce prywatności.</a>'''
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ # Move the newsletter field to the end.
+ f = self.fields['agree_newsletter']
+ del self.fields['agree_newsletter']
+ self.fields['agree_newsletter'] = f
+
@property
def data_processing(self):
return mark_safe('%s %s %s' % (self.data_processing_part1, self.data_processing_part2, self.data_processing_part3))
@property
def data_processing(self):
return mark_safe('%s %s %s' % (self.data_processing_part1, self.data_processing_part2, self.data_processing_part3))
@@
-50,6
+57,7
@@
Więcej informacji w <a href="">polityce prywatności.</a>'''
class SubscribeForm(NewsletterForm):
mailing = True
agree_newsletter = None
class SubscribeForm(NewsletterForm):
mailing = True
agree_newsletter = None
+ required_css_class = 'required'
email = EmailField(label=_('email address'))
email = EmailField(label=_('email address'))