Don't log to sentry in debug mode (#4576)

This commit is contained in:
Oliver 2023-04-04 14:54:40 +10:00 committed by GitHub
parent 78c6f9b90a
commit 1ddc86d6a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,7 @@ def exception_handler(exc, context):
"""
response = None
if settings.SENTRY_ENABLED and settings.SENTRY_DSN:
if settings.SENTRY_ENABLED and settings.SENTRY_DSN and not settings.DEBUG:
# Report this exception to sentry.io
from sentry_sdk import capture_exception
capture_exception(exc)