summaryrefslogtreecommitdiff
path: root/django/core/mail/__init__.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-03-28 18:33:29 -0400
committerTim Graham <timograham@gmail.com>2016-04-08 09:51:06 -0400
commitdf8d8d4292684d6ffa7474f1e201aed486f02b53 (patch)
treec661bf9b33de5288afe4f63347a2a9c768ef98eb /django/core/mail/__init__.py
parent2956e2f5e3f63d279f5dae2a995265364d3e6db1 (diff)
Fixed E128 flake8 warnings in django/.
Diffstat (limited to 'django/core/mail/__init__.py')
-rw-r--r--django/core/mail/__init__.py42
1 files changed, 25 insertions, 17 deletions
diff --git a/django/core/mail/__init__.py b/django/core/mail/__init__.py
index 9fb3bdb42b..5741f8a829 100644
--- a/django/core/mail/__init__.py
+++ b/django/core/mail/__init__.py
@@ -50,11 +50,12 @@ def send_mail(subject, message, from_email, recipient_list,
Note: The API for this method is frozen. New code wanting to extend the
functionality should use the EmailMessage class directly.
"""
- connection = connection or get_connection(username=auth_user,
- password=auth_password,
- fail_silently=fail_silently)
- mail = EmailMultiAlternatives(subject, message, from_email, recipient_list,
- connection=connection)
+ connection = connection or get_connection(
+ username=auth_user,
+ password=auth_password,
+ fail_silently=fail_silently,
+ )
+ mail = EmailMultiAlternatives(subject, message, from_email, recipient_list, connection=connection)
if html_message:
mail.attach_alternative(html_message, 'text/html')
@@ -75,12 +76,15 @@ def send_mass_mail(datatuple, fail_silently=False, auth_user=None,
Note: The API for this method is frozen. New code wanting to extend the
functionality should use the EmailMessage class directly.
"""
- connection = connection or get_connection(username=auth_user,
- password=auth_password,
- fail_silently=fail_silently)
- messages = [EmailMessage(subject, message, sender, recipient,
- connection=connection)
- for subject, message, sender, recipient in datatuple]
+ connection = connection or get_connection(
+ username=auth_user,
+ password=auth_password,
+ fail_silently=fail_silently,
+ )
+ messages = [
+ EmailMessage(subject, message, sender, recipient, connection=connection)
+ for subject, message, sender, recipient in datatuple
+ ]
return connection.send_messages(messages)
@@ -89,9 +93,11 @@ def mail_admins(subject, message, fail_silently=False, connection=None,
"""Sends a message to the admins, as defined by the ADMINS setting."""
if not settings.ADMINS:
return
- mail = EmailMultiAlternatives('%s%s' % (settings.EMAIL_SUBJECT_PREFIX, subject),
- message, settings.SERVER_EMAIL, [a[1] for a in settings.ADMINS],
- connection=connection)
+ mail = EmailMultiAlternatives(
+ '%s%s' % (settings.EMAIL_SUBJECT_PREFIX, subject), message,
+ settings.SERVER_EMAIL, [a[1] for a in settings.ADMINS],
+ connection=connection,
+ )
if html_message:
mail.attach_alternative(html_message, 'text/html')
mail.send(fail_silently=fail_silently)
@@ -102,9 +108,11 @@ def mail_managers(subject, message, fail_silently=False, connection=None,
"""Sends a message to the managers, as defined by the MANAGERS setting."""
if not settings.MANAGERS:
return
- mail = EmailMultiAlternatives('%s%s' % (settings.EMAIL_SUBJECT_PREFIX, subject),
- message, settings.SERVER_EMAIL, [a[1] for a in settings.MANAGERS],
- connection=connection)
+ mail = EmailMultiAlternatives(
+ '%s%s' % (settings.EMAIL_SUBJECT_PREFIX, subject), message,
+ settings.SERVER_EMAIL, [a[1] for a in settings.MANAGERS],
+ connection=connection,
+ )
if html_message:
mail.attach_alternative(html_message, 'text/html')
mail.send(fail_silently=fail_silently)