Projet

Général

Profil

0004-emails-validators-do-not-raise-validation-error-on-t.patch

Christophe Siraut, 18 avril 2019 11:08

Télécharger (1,03 ko)

Voir les différences:

Subject: [PATCH 4/5] emails/validators: do not raise validation error on
 temporary failures (#32435)

 hobo/emails/validators.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
hobo/emails/validators.py
41 41
        raise ValidationError(_('Error while connecting to %(server)s: %(msg)s') % {'server': mx_server, 'msg': msg})
42 42
    smtp.mail('')
43 43
    status, msg = smtp.rcpt(value)
44
    if status == 250:
44
    if status >= 500:
45 45
        smtp.quit()
46
        return
46
        raise ValidationError(_('Email address not found on %s') % mx_server)
47 47
    smtp.quit()
48
    raise ValidationError(_('Email address not found on %s') % mx_server)
49 48

  
50 49

  
51 50
def validate_email_spf(value, strict=False):
52
-