2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-14 02:55:41 +00:00

chore: don't confuse type checker by fetching after the if (#3344)

This commit is contained in:
nwns
2022-07-17 16:15:52 -06:00
committed by GitHub
parent 6e2a2f2b2c
commit ce0af287f2

View File

@ -114,9 +114,9 @@ C) Look for default key file "secret_key.txt"
d) Create "secret_key.txt" if it does not exist
"""
if os.getenv("INVENTREE_SECRET_KEY"):
if secret_key := os.getenv("INVENTREE_SECRET_KEY"):
# Secret key passed in directly
SECRET_KEY = os.getenv("INVENTREE_SECRET_KEY").strip() # pragma: no cover
SECRET_KEY = secret_key.strip() # pragma: no cover
logger.info("SECRET_KEY loaded by INVENTREE_SECRET_KEY") # pragma: no cover
else:
# Secret key passed in by file location