mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #15750 -- Handle empty mail server credentials gracefully. Thanks, LeandroSouza and bedmondmark.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16494 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -18,8 +18,14 @@ class EmailBackend(BaseEmailBackend):
|
||||
super(EmailBackend, self).__init__(fail_silently=fail_silently)
|
||||
self.host = host or settings.EMAIL_HOST
|
||||
self.port = port or settings.EMAIL_PORT
|
||||
self.username = username or settings.EMAIL_HOST_USER
|
||||
self.password = password or settings.EMAIL_HOST_PASSWORD
|
||||
if username is None:
|
||||
self.username = settings.EMAIL_HOST_USER
|
||||
else:
|
||||
self.username = username
|
||||
if password is None:
|
||||
self.password = settings.EMAIL_HOST_PASSWORD
|
||||
else:
|
||||
self.password = password
|
||||
if use_tls is None:
|
||||
self.use_tls = settings.EMAIL_USE_TLS
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user