EmailMessage.to accepts tuple or list, but EmailMessage.recipients() fails if it's a tuple
Basically, if you set "to" to a tuple, the recipients() method fails because it's concatenating self.to + self.bcc, and bcc by default is []. So if self.to is a tuple, you get an exception. The simple fix is:
Index: django/core/mail.py
===================================================================
--- django/core/mail.py (revision 11587)
+++ django/core/mail.py (working copy)
@@ -255,7 +255,7 @@
Returns a list of all recipients of the email (includes direct
addressees as well as Bcc entries).
"""
- return self.to + self.bcc
+ return list(self.to) + list(self.bcc)
def send(self, fail_silently=False):
"""Sends the email message."""
Change History
(9)
Owner: |
changed from nobody to Ben Davis
|
Status: |
new → assigned
|
Needs tests: |
set
|
Triage Stage: |
Unreviewed → Accepted
|
Severity: |
→ Normal
|
Type: |
→ Bug
|
Easy pickings: |
unset
|
Keywords: |
mail to tuple removed
|
Needs tests: |
unset
|
Type: |
Bug → Cleanup/optimization
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
Updated for 1.2-beta