Skip to content

Commit

Permalink
ensure SECRET_KEY also honored in environment
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch committed Oct 12, 2022
1 parent ea1a148 commit b9335b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shub/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
STRING_DEFAULTS = {
# Will be converted to list, and defaults to "*"
"ALLOWED_HOSTS": None,
"SECRET_KEY": None,
"API_VERSION": "v1",
"API_ANON_THROTTLE_RATE": "100/day",
"API_USER_THROTTLE_RATE": "1000/day",
Expand Down Expand Up @@ -159,7 +160,6 @@
"AUTH_LDAP_STAFF_GROUP_FLAGS": None, # "cn=staff,ou=django,ou=groups,dc=example,dc=com",
# Anyone in this group is a superuser for the app
"AUTH_LDAP_SUPERUSER_GROUP_FLAGS": None, # "cn=superuser,ou=django,ou=groups,dc=example,dc=com"
# "cn=sregistry_admin,ou=groups,dc=example,dc=com"
# Globus Assocation (globus)
# Only required if 'globus' is added to PLUGINS_ENABLED in config.py
"SOCIAL_AUTH_GLOBUS_KEY": None,
Expand Down Expand Up @@ -654,7 +654,7 @@ def __iter__(self):
)

# If we don't have a secret key, no go
if "SECRET_KEY" not in locals():
if "SECRET_KEY" not in locals() or "SECRET_KEY" in locals() and not locals()["SECRET_KEY"]:
sys.exit("SECRET_KEY is required but not set. Set SREGISTRY_SECRET_KEY.")


Expand Down

0 comments on commit b9335b6

Please sign in to comment.