From 078633c2af7b805c3c043e38cb34ee3698c4d04e Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 15 Nov 2021 22:18:56 +0100 Subject: [PATCH] lib: drop all sentry exceptions when debug enabled Signed-off-by: Jens Langhammer --- authentik/lib/sentry.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/authentik/lib/sentry.py b/authentik/lib/sentry.py index 8d91a83b1..dd5673b8b 100644 --- a/authentik/lib/sentry.py +++ b/authentik/lib/sentry.py @@ -8,6 +8,7 @@ from botocore.exceptions import BotoCoreError from celery.exceptions import CeleryError from channels.middleware import BaseMiddleware from channels_redis.core import ChannelFull +from django.conf import settings from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation, ValidationError from django.db import InternalError, OperationalError, ProgrammingError from django.http.response import Http404 @@ -107,4 +108,6 @@ def before_send(event: dict, hint: dict) -> Optional[dict]: "django_redis", ]: return None + if settings.DEBUG: + return None return event