mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #30058 -- Made SMTP EmailBackend.send_messages() return 0 for empty/error cases.
This commit is contained in:
committed by
Tim Graham
parent
0b54ab0675
commit
277de22984
@@ -98,13 +98,13 @@ class EmailBackend(BaseEmailBackend):
|
||||
messages sent.
|
||||
"""
|
||||
if not email_messages:
|
||||
return
|
||||
return 0
|
||||
with self._lock:
|
||||
new_conn_created = self.open()
|
||||
if not self.connection or new_conn_created is None:
|
||||
# We failed silently on open().
|
||||
# Trying to send would be pointless.
|
||||
return
|
||||
return 0
|
||||
num_sent = 0
|
||||
for message in email_messages:
|
||||
sent = self._send(message)
|
||||
|
||||
Reference in New Issue
Block a user