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
This commit is contained in:
Russell Keith-Magee 2011-03-17 10:33:08 +00:00
parent 354aa941b6
commit 7ab5ce6cf1
1 changed files with 5 additions and 1 deletions

View File

@ -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"