X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/82b08f79564159d7acbcaf255ed1ac1fb4882e64..d19e216035b14d8f60b24dda0c0670e6997f16ce:/contrib/penfield/middleware.py diff --git a/contrib/penfield/middleware.py b/contrib/penfield/middleware.py deleted file mode 100644 index b25a28b..0000000 --- a/contrib/penfield/middleware.py +++ /dev/null @@ -1,14 +0,0 @@ -from django.http import HttpResponse -from django.utils.decorators import decorator_from_middleware -from philo.contrib.penfield.exceptions import HttpNotAcceptable - - -class HttpNotAcceptableMiddleware(object): - """Middleware to catch HttpNotAcceptable errors and return an Http406 response. - See RFC 2616.""" - def process_exception(self, request, exception): - if isinstance(exception, HttpNotAcceptable): - return HttpResponse(status=406) - - -http_not_acceptable = decorator_from_middleware(HttpNotAcceptableMiddleware) \ No newline at end of file