Update sentry settings

This commit is contained in:
Ramon Wenger 2021-03-22 17:23:16 +01:00
parent 1196c4ff80
commit d97b46fc23
1 changed files with 5 additions and 2 deletions

View File

@ -35,6 +35,7 @@ DEBUG = bool_value(os.environ.get('DEBUG', ''))
TEST = 'test' in sys.argv
ENABLE_SILKY = bool_value(os.environ.get('ENABLE_SILKY', ''))
SERVE_VIA_WEBPACK = bool_value(os.environ.get('SERVE_VIA_WEBPACK', DEBUG))
ENABLE_SENTRY = not DEBUG or bool_value(os.environ.get('ENABLE_SENTRY_DEBUG', ''))
ALLOWED_HOSTS = ['*']
@ -44,6 +45,7 @@ if not DEBUG:
# Application definition
INSTALLED_APPS = [
'core',
'api',
@ -318,16 +320,18 @@ LOGGING = {
}
}
if not DEBUG and os.environ.get('SENTRY_DSN'):
if ENABLE_SENTRY and os.environ.get('SENTRY_DSN'):
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
def before_send(event, hint):
user = event['user']
id = user['id']
event['user'] = {'id': id}
return event
environment = os.environ.get('SENTRY_ENV', 'localhost')
sentry_sdk.init(
@ -391,7 +395,6 @@ TASKBASE_SUPERPASSWORD = os.environ.get("TASKBASE_SUPERPASSWORD")
TASKBASE_BASEURL = os.environ.get("TASKBASE_BASEURL")
ENABLE_SPELLCHECK = True if TASKBASE_BASEURL else False
TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner'
TEST_OUTPUT_DIR = './test-reports/'
TEST_OUTPUT_VERBOSE = 1