Merge branch 'hotfix/enable-pii' into develop

This commit is contained in:
Ramon Wenger 2021-03-18 14:32:35 +01:00
commit c60af4acc2
1 changed files with 17 additions and 0 deletions

View File

@ -343,6 +343,23 @@ LOGGING = {
}
}
if not DEBUG 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
sentry_sdk.init(
dsn=os.environ.get('SENTRY_DSN'),
integrations=[DjangoIntegration()],
send_default_pii=True,
before_send=before_send
)
if not DEBUG and os.environ.get('SENTRY_DSN'):
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration