aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoar Wandborg <git@wandborg.com>2011-05-07 00:57:39 +0200
committerJoar Wandborg <git@wandborg.com>2011-05-07 00:57:39 +0200
commit85e1bc316ec7010d06e95b35d3496ad3ecf7ef78 (patch)
treeabea7db256ef1107d0f8906d4298fec2e5ebed24
parent67e63926f929cf7b6665fba00238fec227b5831e (diff)
downloadmediagoblin-85e1bc316ec7010d06e95b35d3496ad3ecf7ef78.tar.lz
mediagoblin-85e1bc316ec7010d06e95b35d3496ad3ecf7ef78.tar.xz
mediagoblin-85e1bc316ec7010d06e95b35d3496ad3ecf7ef78.zip
mediagoblin.util.send_email now supports both list() and string() in the 'to_addrs' parameter
Signed-off-by: Joar Wandborg <git@wandborg.com>
-rw-r--r--mediagoblin/util.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mediagoblin/util.py b/mediagoblin/util.py
index d24b59b6..0d8bcae2 100644
--- a/mediagoblin/util.py
+++ b/mediagoblin/util.py
@@ -163,7 +163,8 @@ def send_email(from_addr, to_addrs, subject, message_body):
message = MIMEText(message_body.encode('utf-8'), 'plain', 'utf-8')
message['Subject'] = subject
message['From'] = from_addr
- message['To'] = ', '.join(to_addrs)
+ # The shorthand condition takes height for the possibility that the to_addrs argument can be either list() or string()
+ message['To'] = ', '.join(to_addrs) if type( to_addrs ) == list else to_addrs
if TESTS_ENABLED:
EMAIL_TEST_INBOX.append(message)