Opened 5 years ago

Closed 5 years ago

#21383 closed Cleanup/optimization (fixed)

Suspicious Operation Error Emails lacks request details

Reported by: anonymous Owned by: nobody
Component: Core (Other) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no


While using the AdminEmailHandler to log errors the traceback (if available) and request information is included in the email when the BaseHandler handles the request. If the error is a SuspiciousOperation the request information is not included, instead the email just has "Request repr() unavailable.".

Including the request details in the logging call is a simple change and provides some useful details in what occurred. The change is in django/core/handlers/ on line 177:


can be changed to

            security_logger.error(force_text(e), extra={'status_code': '400', 'request': request})

Change History (2)

comment:1 Changed 5 years ago by Claude Paroz

Component: UncategorizedCore (Other)
Needs tests: set
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:2 Changed 5 years ago by Claude Paroz <claude@…>

Resolution: fixed
Status: newclosed

In e6dd70b4dba3b7d812fecda7288c9707990ea71b:

Fixed #21383 -- Added request details in SuspiciousOperation messages

Note: See TracTickets for help on using tickets.
Back to Top