Ticket #15750: 15750.diff

File 15750.diff, 898 bytes (added by LeandroSouza, 4 years ago)

Allow for empty username and/or password.

  • django/core/mail/backends/smtp.py

     
    1818        super(EmailBackend, self).__init__(fail_silently=fail_silently)
    1919        self.host = host or settings.EMAIL_HOST
    2020        self.port = port or settings.EMAIL_PORT
    21         self.username = username or settings.EMAIL_HOST_USER
    22         self.password = password or settings.EMAIL_HOST_PASSWORD
     21        if username is None:
     22            self.username = settings.EMAIL_HOST_USER
     23        else:
     24            self.username = username
     25        if password is None:
     26            self.password = settings.EMAIL_HOST_PASSWORD
     27        else:
     28            self.password = password
    2329        if use_tls is None:
    2430            self.use_tls = settings.EMAIL_USE_TLS
    2531
Back to Top