mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.5.x] Fixed #19382 -- Stopped smtp backend raising exception when already closed
Thanks Sebastian Noack for the report and the initial patch.
Backport of ffa50ca35 from master.
This commit is contained in:
@@ -60,6 +60,8 @@ class EmailBackend(BaseEmailBackend):
|
||||
|
||||
def close(self):
|
||||
"""Closes the connection to the email server."""
|
||||
if self.connection is None:
|
||||
return
|
||||
try:
|
||||
try:
|
||||
self.connection.quit()
|
||||
|
||||
Reference in New Issue
Block a user