X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/0bd2c341a8b55f817c2e193a6c4658d52ef95961..ad39c2501159fa52e980c95af3e735e36b459c15:/apps/suggest/forms.py diff --git a/apps/suggest/forms.py b/apps/suggest/forms.py index 35fbaf646..b98e0ae4a 100644 --- a/apps/suggest/forms.py +++ b/apps/suggest/forms.py @@ -4,6 +4,7 @@ # from django import forms from django.contrib.sites.models import Site +from django.core.exceptions import ValidationError from django.core.mail import send_mail, mail_managers from django.core.urlresolvers import reverse from django.core.validators import validate_email @@ -41,7 +42,11 @@ Kontakt: %(contact)s 'description': description, }, fail_silently=True) - if validate_email(contact): + try: + validate_email(contact) + except ValidationError: + pass + else: send_mail(u'[WolneLektury] ' + ugettext(u'Thank you for your suggestion.'), ugettext(u"""\ @@ -96,7 +101,11 @@ Audiobooki: 'audiobooks': audiobooks, }, fail_silently=True) - if validate_email(contact): + try: + validate_email(contact) + except ValidationError: + pass + else: send_mail(u'[WolneLektury] ' + ugettext(u'Thank you for your suggestion.'), ugettext(u"""\