Skip to content

Commit

Permalink
Fix: runtime env calculation (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman authored Jan 28, 2025
2 parents a3efa4d + e43c2a3 commit 954d09f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def RUNTIME_ENVIRONMENT():
# usage of django.conf.settings.ALLOWED_HOSTS here (rather than the module variable directly)
# is to ensure dynamic calculation, e.g. for unit tests and elsewhere this setting is needed
env = RUNTIME_ENVS.LOCAL
if "dev" in settings.ALLOWED_HOSTS:
if any(["dev" in host for host in settings.ALLOWED_HOSTS]):
env = RUNTIME_ENVS.DEV
elif "test" in settings.ALLOWED_HOSTS:
elif any(["test" in host for host in settings.ALLOWED_HOSTS]):
env = RUNTIME_ENVS.TEST
elif "disasterrecovery.ca.gov" in settings.ALLOWED_HOSTS:
env = RUNTIME_ENVS.PROD
Expand Down

0 comments on commit 954d09f

Please sign in to comment.