#13494 closed (fixed)
Bad default for EMAIL_SUBJECT_PREFIX
Reported by: | Henrique C. Alves | Owned by: | Andi Albrecht |
---|---|---|---|
Component: | Core (Mail) | Version: | 1.1 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The 'EMAIL_SUBJECT_PREFIX' setting is, by default, a string. This makes it break loud and needlessly if you pass a translation as the subject to 'mail_managers()':
TypeError cannot concatenate 'str' and '__proxy__' objects
The culprit line of django/core/mail.py:
424. EmailMessage(settings.EMAIL_SUBJECT_PREFIX + subject, message, ...
Seems like an easy fix (just change the default setting to unicode?).
Attachments (2)
Change History (10)
comment:1 by , 15 years ago
milestone: | 2.0 |
---|
comment:2 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
by , 14 years ago
Attachment: | bug13494.diff added |
---|
comment:3 by , 14 years ago
Has patch: | set |
---|
comment:4 by , 14 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:5 by , 14 years ago
milestone: | → 1.3 |
---|
by , 14 years ago
Attachment: | bug13494.2.diff added |
---|
comment:6 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:7 by , 14 years ago
Note:
See TracTickets
for help on using tickets.
A couple of workarounds could be wrapping your translatable subject with a call to call unicode() before passing it to
mail_managers()
or using string_concat().