summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2016-05-03 18:22:46 +0200
committerClaude Paroz <claude@2xlibre.net>2016-05-10 18:17:43 +0200
commitc3e108694966f045adcc0ba11133a2b3bf238770 (patch)
tree94d3dfa8c80dc34592ee7c16df470eeb1fc2f034 /django/utils
parent31e0314979f6aa1c66828b55dd222c32aad94e9e (diff)
Stopped truncating AdminEmailHandler message subjects
Refs #26572, #17281. The RFC doesn't limit total length, just the line length which is already taken care of by Python itself. Thanks Tim Graham for the review.
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/log.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/django/utils/log.py b/django/utils/log.py
index cc15dfa636..b60b9add98 100644
--- a/django/utils/log.py
+++ b/django/utils/log.py
@@ -128,12 +128,9 @@ class AdminEmailHandler(logging.Handler):
def format_subject(self, subject):
"""
- Escape CR and LF characters, and limit length.
- RFC 2822's hard limit is 998 characters per line. So, minus "Subject: "
- the actual subject must be no longer than 989 characters.
+ Escape CR and LF characters.
"""
- formatted_subject = subject.replace('\n', '\\n').replace('\r', '\\r')
- return formatted_subject[:989]
+ return subject.replace('\n', '\\n').replace('\r', '\\r')
class CallbackFilter(logging.Filter):