diff --git a/django/core/mail/__init__.py b/django/core/mail/__init__.py
index f9d1210..8a2d9bf 100644
a
|
b
|
def mail_admins(subject, message, fail_silently=False, connection=None):
|
87 | 87 | """Sends a message to the admins, as defined by the ADMINS setting.""" |
88 | 88 | if not settings.ADMINS: |
89 | 89 | return |
90 | | EmailMessage(settings.EMAIL_SUBJECT_PREFIX + subject, message, |
| 90 | EmailMessage(u'%s%s' % (settings.EMAIL_SUBJECT_PREFIX, subject), message, |
91 | 91 | settings.SERVER_EMAIL, [a[1] for a in settings.ADMINS], |
92 | 92 | connection=connection).send(fail_silently=fail_silently) |
93 | 93 | |
… |
… |
def mail_managers(subject, message, fail_silently=False, connection=None):
|
96 | 96 | """Sends a message to the managers, as defined by the MANAGERS setting.""" |
97 | 97 | if not settings.MANAGERS: |
98 | 98 | return |
99 | | EmailMessage(settings.EMAIL_SUBJECT_PREFIX + subject, message, |
| 99 | EmailMessage(u'%s%s' % (settings.EMAIL_SUBJECT_PREFIX, subject), message, |
100 | 100 | settings.SERVER_EMAIL, [a[1] for a in settings.MANAGERS], |
101 | 101 | connection=connection).send(fail_silently=fail_silently) |
102 | 102 | |
diff --git a/tests/regressiontests/mail/tests.py b/tests/regressiontests/mail/tests.py
index 84be585..6b93304 100644
a
|
b
|
Message-ID: ...
|
414 | 414 | Content |
415 | 415 | ------------------------------------------------------------------------------- |
416 | 416 | |
| 417 | # Make sure that adding a prefix works with translated subject (#13494). |
| 418 | >>> mail_managers(ugettext_lazy('Subject'), 'Content', connection=connection) |
| 419 | Content-Type: text/plain; charset="utf-8" |
| 420 | MIME-Version: 1.0 |
| 421 | Content-Transfer-Encoding: quoted-printable |
| 422 | Subject: [Django] Subject |
| 423 | From: root@localhost |
| 424 | To: nobody@example.com |
| 425 | Date: ... |
| 426 | Message-ID: ... |
| 427 | |
| 428 | Content |
| 429 | ------------------------------------------------------------------------------- |
| 430 | |
| 431 | >>> mail_admins(ugettext_lazy('Subject'), 'Content', connection=connection) |
| 432 | Content-Type: text/plain; charset="utf-8" |
| 433 | MIME-Version: 1.0 |
| 434 | Content-Transfer-Encoding: quoted-printable |
| 435 | Subject: [Django] Subject |
| 436 | From: root@localhost |
| 437 | To: nobody@example.com |
| 438 | Date: ... |
| 439 | Message-ID: ... |
| 440 | |
| 441 | Content |
| 442 | ------------------------------------------------------------------------------- |
| 443 | |
| 444 | |
417 | 445 | >>> settings.ADMINS = old_admins |
418 | 446 | >>> settings.MANAGERS = old_managers |
419 | 447 | |