Permalink
Browse files

Fixed #7655 -- Added two assertions to mail.py to help people debug a…

… common problem (sending strings instead of lists/tuples for 'to' or 'bcc'). Thanks, guettli

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7864 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent b0d3803 commit f19284b85aed37fd4008c56f1aa7a36517305e54 @adrianholovaty adrianholovaty committed Jul 8, 2008
Showing with 2 additions and 0 deletions.
  1. +2 −0 django/core/mail.py
View
@@ -205,10 +205,12 @@ def __init__(self, subject='', body='', from_email=None, to=None, bcc=None,
conversions.
"""
if to:
+ assert not isinstance(to, basestring), '"to" argument must be a list or tuple'
self.to = list(to)
else:
self.to = []
if bcc:
+ assert not isinstance(bcc, basestring), '"bcc" argument must be a list or tuple'
self.bcc = list(bcc)
else:
self.bcc = []

0 comments on commit f19284b

Please sign in to comment.