Skip to content

Commit

Permalink
redis is_copilot if statement added
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulWheatcroft committed Jun 17, 2024
1 parent 3da586b commit 63e3672
Showing 1 changed file with 12 additions and 28 deletions.
40 changes: 12 additions & 28 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,8 @@
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"
}, # noqa
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
{
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"
},
{
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"
},
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
]

# Internationalization
Expand Down Expand Up @@ -199,22 +195,16 @@ def FILTERS_VERBOSE_LOOKUPS():

# If "temp" is in instance name it means it's the temp files bucket
if "temp" in bucket["instance_name"]:
TEMP_FILE_AWS_ACCESS_KEY_ID = app_bucket_credentials[
"aws_access_key_id"
]
TEMP_FILE_AWS_ACCESS_KEY_ID = app_bucket_credentials["aws_access_key_id"]
TEMP_FILE_AWS_SECRET_ACCESS_KEY = app_bucket_credentials[
"aws_secret_access_key"
]
TEMP_FILE_AWS_REGION = app_bucket_credentials["aws_region"]
TEMP_FILE_AWS_S3_REGION_NAME = app_bucket_credentials["aws_region"]
TEMP_FILE_AWS_STORAGE_BUCKET_NAME = app_bucket_credentials[
"bucket_name"
]
TEMP_FILE_AWS_STORAGE_BUCKET_NAME = app_bucket_credentials["bucket_name"]
else:
AWS_ACCESS_KEY_ID = app_bucket_credentials["aws_access_key_id"]
AWS_SECRET_ACCESS_KEY = app_bucket_credentials[
"aws_secret_access_key"
]
AWS_SECRET_ACCESS_KEY = app_bucket_credentials["aws_secret_access_key"]
AWS_REGION = app_bucket_credentials["aws_region"]
AWS_S3_REGION_NAME = app_bucket_credentials["aws_region"]
AWS_STORAGE_BUCKET_NAME = app_bucket_credentials["bucket_name"]
Expand All @@ -225,12 +215,8 @@ def FILTERS_VERBOSE_LOOKUPS():
AWS_S3_REGION_NAME = env("AWS_REGION", default="")
AWS_STORAGE_BUCKET_NAME = env("AWS_STORAGE_BUCKET_NAME", default="")

TEMP_FILE_AWS_ACCESS_KEY_ID = env(
"TEMP_FILE_AWS_ACCESS_KEY_ID", default=""
)
TEMP_FILE_AWS_SECRET_ACCESS_KEY = env(
"TEMP_FILE_AWS_SECRET_ACCESS_KEY", default=""
)
TEMP_FILE_AWS_ACCESS_KEY_ID = env("TEMP_FILE_AWS_ACCESS_KEY_ID", default="")
TEMP_FILE_AWS_SECRET_ACCESS_KEY = env("TEMP_FILE_AWS_SECRET_ACCESS_KEY", default="")
TEMP_FILE_AWS_REGION = env("TEMP_FILE_AWS_REGION", default="")
TEMP_FILE_AWS_S3_REGION_NAME = env("TEMP_FILE_AWS_REGION", default="")
TEMP_FILE_AWS_STORAGE_BUCKET_NAME = env(
Expand All @@ -243,7 +229,9 @@ def FILTERS_VERBOSE_LOOKUPS():
AWS_DEFAULT_ACL = None

# Redis
if "redis" in VCAP_SERVICES:
if is_copilot():
REDIS_URL = env("REDIS_URL", default=None) + "?ssl_cert_reqs=required"
elif "redis" in VCAP_SERVICES:
credentials = VCAP_SERVICES["redis"][0]["credentials"]

REDIS_URL = "rediss://:{}@{}:{}/0?ssl_cert_reqs=required".format(
Expand Down Expand Up @@ -357,12 +345,8 @@ def FILTERS_VERBOSE_LOOKUPS():

# Vite
VITE_DEV = env.bool("VITE_DEV", default=False)
VITE_DEV_SERVER_URL = env.str(
"VITE_DEV_SERVER_URL", default="http://localhost:5173"
)
VITE_MANIFEST_PATH = (
BASE_DIR / "front_end" / "build" / ".vite" / "manifest.json"
)
VITE_DEV_SERVER_URL = env.str("VITE_DEV_SERVER_URL", default="http://localhost:5173")
VITE_MANIFEST_PATH = BASE_DIR / "front_end" / "build" / ".vite" / "manifest.json"

# Selenium (BDD tests)
USE_REMOTE_CHROME = env("USE_REMOTE_CHROME", default=True)
Expand Down

0 comments on commit 63e3672

Please sign in to comment.