mirror of
https://github.com/django/django.git
synced 2025-04-16 13:24:38 +00:00
magic-removal: Fixed #1384 - ugly bug in mail_admins. Added additional try blocks.
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2433 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
04b22e5002
commit
f9ed0eded9
@ -43,9 +43,19 @@ def send_mass_mail(datatuple, fail_silently=False):
|
||||
msg['Subject'] = subject
|
||||
msg['From'] = from_email
|
||||
msg['To'] = ', '.join(recipient_list)
|
||||
server.sendmail(from_email, recipient_list, msg.as_string())
|
||||
num_sent += 1
|
||||
server.quit()
|
||||
try:
|
||||
server.sendmail(from_email, recipient_list, msg.as_string())
|
||||
num_sent += 1
|
||||
except:
|
||||
if fail_silently:
|
||||
return
|
||||
raise
|
||||
try:
|
||||
server.quit()
|
||||
except:
|
||||
if fail_silently:
|
||||
return
|
||||
raise
|
||||
return num_sent
|
||||
|
||||
def mail_admins(subject, message, fail_silently=False):
|
||||
|
Loading…
x
Reference in New Issue
Block a user