+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ # Move the newsletter field to the end.
+ if 'agree_newsletter' in self.fields:
+ 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))
+
+ def save(self, *args, **kwargs):
+ newsletter = self.newsletter or Newsletter.objects.filter(slug='').first()
+ if not newsletter:
+ return
+
+ if not (self.mailing or self.cleaned_data.get(self.mailing_field)):
+ return
+ email = self.cleaned_data[self.email_field]