Super User Conditional Page Exception Reporting

1
2
3
4
5
6
7
from django.views.debug import technical_500_response
import sys

class UserBasedExceptionMiddleware(object):
    def process_exception(self, request, exception):
        if request.user.is_superuser:
            return technical_500_response(request, *sys.exc_info())

More like this

  1. SSL Redirect Middleware by zbyte64 5 years, 9 months ago
  2. Technical 500 by group membership by jdunck 4 years, 7 months ago
  3. Optimistic locking in Admin by Taifu 2 years, 8 months ago
  4. Little middleware that create a facebook user by marinho 6 years, 4 months ago
  5. Simple Exception Response for AJAX debugging by newmaniese 6 years, 1 month ago

Comments

(Forgotten your password?)