This commit is contained in:
@@ -9,8 +9,8 @@ app_config = apps.get_containing_app_config(__package__)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class AbstractMail(object):
|
||||
_subject = u''
|
||||
class AbstractMail: # pylint: disable=too-few-public-methods
|
||||
_subject = ''
|
||||
_template_name = None
|
||||
|
||||
def _get_sender(self):
|
||||
@@ -20,7 +20,7 @@ class AbstractMail(object):
|
||||
if subject_fmt is None:
|
||||
subject_fmt = self._subject
|
||||
if app_config.settings.email_subject_prefix:
|
||||
subject_fmt = u'%s %s' % (app_config.settings.email_subject_prefix, subject_fmt)
|
||||
subject_fmt = '%s %s' % (app_config.settings.email_subject_prefix, subject_fmt)
|
||||
subject = subject_fmt.format(**kwargs)
|
||||
return subject
|
||||
|
||||
@@ -57,7 +57,7 @@ class AbstractMail(object):
|
||||
|
||||
email = EmailMessage(subject=subject, body=body, from_email=sender, to=recipients, reply_to=reply_to)
|
||||
if fail_silently:
|
||||
logger.info(u'Fake sending %s to %s', self.__class__.__name__, recipients)
|
||||
logger.info('Fake sending %s to %s', self.__class__.__name__, recipients)
|
||||
else:
|
||||
logger.info(u'Send %s to %s', self.__class__.__name__, recipients)
|
||||
logger.info('Send %s to %s', self.__class__.__name__, recipients)
|
||||
email.send(fail_silently=fail_silently)
|
||||
|
||||
Reference in New Issue
Block a user