From 4a32a98bd9f65e3dd7ae0a7193fd70ab247964d0 Mon Sep 17 00:00:00 2001 From: Sam Dudley Date: Thu, 3 Oct 2024 10:05:10 +0100 Subject: [PATCH] finishing touches --- config/settings/base.py | 6 +++--- config/settings/dev.py | 6 ------ config/settings/prod.py | 6 ------ 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/config/settings/base.py b/config/settings/base.py index 42147196..2fa2e73a 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -391,12 +391,12 @@ def FILTERS_VERBOSE_LOOKUPS(): # Sentry # https://docs.sentry.io/platforms/python/guides/django/ -SENTRY_ENVIRONMENT = env("SENTRY_ENVIRONMENT", None) -SENTRY_DSN = env("SENTRY_DSN", None) +SENTRY_ENVIRONMENT = env.str("SENTRY_ENVIRONMENT", None) +SENTRY_DSN = env.str("SENTRY_DSN", None) # Configure sentry if a DSN is set if SENTRY_DSN: - # AWS Prefix needs to be removed once migration is complete + # TODO: AWS Prefix needs to be removed once migration is complete. sentry_environment = ( f"aws-{SENTRY_ENVIRONMENT}" if is_copilot() else SENTRY_ENVIRONMENT ) diff --git a/config/settings/dev.py b/config/settings/dev.py index 1598f641..f671b17c 100644 --- a/config/settings/dev.py +++ b/config/settings/dev.py @@ -24,12 +24,6 @@ # Set async file uploading ASYNC_FILE_UPLOAD = True -sentry_sdk.init( - os.environ.get("SENTRY_DSN"), - environment=os.environ.get("SENTR Y_ENVIRONMENT"), - integrations=[DjangoIntegration()], -) - # HSTS (https://man.uktrade.io/docs/procedures/1st-go-live.html) SECURE_HSTS_SECONDS = 3600 SECURE_HSTS_PRELOAD = True diff --git a/config/settings/prod.py b/config/settings/prod.py index ae3abc1b..4415299b 100644 --- a/config/settings/prod.py +++ b/config/settings/prod.py @@ -27,12 +27,6 @@ # Set async file uploading ASYNC_FILE_UPLOAD = True -sentry_sdk.init( - os.environ.get("SENTRY_DSN"), - environment=os.environ.get("SENTRY_ENVIRONMENT"), - integrations=[DjangoIntegration()], -) - # Django staff SSO user migration process requries the following MIGRATE_EMAIL_USER_ON_LOGIN = True