Commit b4a91ff4 by David Ormsbee

Suppress op level exception logging middleware if TEMPLATE_DEBUG=True

parent 9a0af7f4
import logging import logging
from django.conf import settings
from django.http import HttpResponse from django.http import HttpResponse
log = logging.getLogger("mitx") log = logging.getLogger("mitx")
...@@ -8,6 +9,7 @@ class ExceptionLoggingMiddleware(object): ...@@ -8,6 +9,7 @@ class ExceptionLoggingMiddleware(object):
"""Just here to log unchecked exceptions that go all the way up the Django """Just here to log unchecked exceptions that go all the way up the Django
stack""" stack"""
if not settings.TEMPLATE_DEBUG:
def process_exception(self, request, exception): def process_exception(self, request, exception):
log.exception(exception) log.exception(exception)
return HttpResponse("Server Error - Please try again later.") return HttpResponse("Server Error - Please try again later.")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment