- try:
- validate_email(email)
- except ValidationError:
- pass
- else:
- send_mail(mail_subject, mail_body, 'edukacjamedialna@nowoczesnapolska.org.pl', [email],
- fail_silently=True)
-
+ if email:
+ try:
+ Confirmation.objects.get(email=email)
+ except Confirmation.DoesNotExist:
+ first_name = f.cleaned_data.get('first_name', None)
+ last_name = f.cleaned_data.get('last_name', None)
+ if first_name and last_name:
+ confirmation = Confirmation.create(
+ first_name=first_name, last_name=last_name, email=email, contact=contact)
+ confirmation.send_mail()