#11928: EmailMessage.to accepts tuple or list, but EmailMessage.recipients() fails if it's a tuple ------------------------------+--------------------------------------------- Reporter: bendavis78 | Owner: nobody Status: new | Milestone: Component: django.core.mail | Version: SVN Keywords: mail to tuple | Stage: Unreviewed Has_patch: 1 | ------------------------------+--------------------------------------------- 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.""" }}} -- Ticket URL: <http://code.djangoproject.com/ticket/11928> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---