From f9daf34df6bfe3feac8a86c95c872b4df27a9927 Mon Sep 17 00:00:00 2001 From: Jeremy Steele Date: Fri, 9 Aug 2024 20:26:51 -0400 Subject: [PATCH] Ignore redirectto exceptions for logger/custom page --- engage/utils/middleware.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engage/utils/middleware.py b/engage/utils/middleware.py index 82c5e1c0a..8bdd74849 100644 --- a/engage/utils/middleware.py +++ b/engage/utils/middleware.py @@ -12,8 +12,11 @@ def __init__(self, get_response): def __call__(self, request): response = self.get_response(request) return response - + def process_exception(self, request, exception): + if isinstance(exception, RedirectTo): + return None + self.logger.exception(str(exception)) return HttpResponseServerError("A server error has occurred and IT has been notified. Please retry your request.")