From f19284b85aed37fd4008c56f1aa7a36517305e54 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Tue, 8 Jul 2008 01:56:01 +0000 Subject: [PATCH] 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 --- django/core/mail.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django/core/mail.py b/django/core/mail.py index bf48dcb882..b60757366f 100644 --- a/django/core/mail.py +++ b/django/core/mail.py @@ -205,10 +205,12 @@ class EmailMessage(object): 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 = []