summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2011-03-17 10:33:08 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2011-03-17 10:33:08 +0000
commit7ab5ce6cf1f2ea01857f828836d1bc6a21c1109f (patch)
tree646650e9cd8e03966d59d9ebcb8f471427d28a43
parent354aa941b6f883a652ee005014579b26fd7542e6 (diff)
Fixed #15628 -- Made the admin error email more useful when there isn't a request associated with the message. Thanks to hynek for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15869 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/utils/log.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/django/utils/log.py b/django/utils/log.py
index 763e667c57..4fb75b1504 100644
--- a/django/utils/log.py
+++ b/django/utils/log.py
@@ -79,7 +79,11 @@ class AdminEmailHandler(logging.Handler):
)
request_repr = repr(request)
except:
- subject = 'Error: Unknown URL'
+ subject = '%s: %s' % (
+ record.levelname,
+ record.msg
+ )
+
request = None
request_repr = "Request repr() unavailable"