summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Lavrinenko <s@lavr.me>2016-04-07 15:23:27 (GMT)
committerSergey Lavrinenko <s@lavr.me>2016-04-07 15:23:27 (GMT)
commit5c8689a4223795eb739a5e4aba0470c5e628fbf6 (patch)
tree9cd7720ba68e8533c949b29ee16d26e66b21aa38
parent153534b17c8db78c98f51d6b875886d5246426e6 (diff)
downloadpython-emails-5c8689a4223795eb739a5e4aba0470c5e628fbf6.zip
python-emails-5c8689a4223795eb739a5e4aba0470c5e628fbf6.tar.gz
python-emails-5c8689a4223795eb739a5e4aba0470c5e628fbf6.tar.bz2
Forgotten cc and bcc in DjangoMessage.recipients
-rw-r--r--emails/django/__init__.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/emails/django/__init__.py b/emails/django/__init__.py
index a9dd409..fa2be93 100644
--- a/emails/django/__init__.py
+++ b/emails/django/__init__.py
@@ -6,6 +6,7 @@ from .. utils import sanitize_email
__all__ = ['DjangoMessageMixin', 'DjangoMessage']
+
class DjangoMessageMixin(object):
_recipients = None
@@ -16,8 +17,10 @@ class DjangoMessageMixin(object):
return self.charset or 'utf-8'
def recipients(self):
- r = self._recipients if self._recipients is not None else [r[1] for r in self.mail_to]
- return [sanitize_email(e) for e in r]
+ ret = self._recipients
+ if ret is None:
+ ret = self.get_recipients_emails()
+ return [sanitize_email(e) for e in ret]
@property
def from_email(self):
@@ -62,4 +65,4 @@ class DjangoMessage(DjangoMessageMixin, MessageTransformerMixin, MessageSignMixi
"""
pass
-Message = DjangoMessage \ No newline at end of file
+Message = DjangoMessage