Disable Sentry in shell sessions

This commit is contained in:
Raphael Michel
2019-08-17 14:05:06 +02:00
parent 9a826b694f
commit 102772ec55

View File

@@ -609,7 +609,7 @@ LOGGING = {
}
SENTRY_ENABLED = False
if config.has_option('sentry', 'dsn'):
if config.has_option('sentry', 'dsn') and not any(c in sys.argv for c in ('shell', 'shell_scoped', 'shell_plus')):
import sentry_sdk
from sentry_sdk.integrations.celery import CeleryIntegration
from sentry_sdk.integrations.logging import LoggingIntegration, ignore_logger
@@ -629,7 +629,6 @@ if config.has_option('sentry', 'dsn'):
environment=SITE_URL,
release=__version__,
send_default_pii=False,
)
ignore_logger('pretix.base.tasks')
ignore_logger('django.security.DisallowedHost')