Ticket #7472: 7472.patch

File 7472.patch, 1.2 KB (added by Fraser Nevett, 16 years ago)
  • django/core/handlers/base.py

     
    124124            else:
    125125                # When DEBUG is False, send an error message to the admins.
    126126                subject = 'Error (%s IP): %s' % ((request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS and 'internal' or 'EXTERNAL'), request.path)
    127                 try:
    128                     request_repr = repr(request)
    129                 except:
    130                     request_repr = "Request repr() unavailable"
     127                if request.is_secure():
     128                    request_repr = "Request omitted because it was made over HTTPS"
     129                else:
     130                    try:
     131                        request_repr = repr(request)
     132                    except:
     133                        request_repr = "Request repr() unavailable"
    131134                message = "%s\n\n%s" % (self._get_traceback(exc_info), request_repr)
    132135                mail_admins(subject, message, fail_silently=True)
    133136                # Return an HttpResponse that displays a friendly error message.
Back to Top