mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
chore: don't confuse type checker by fetching after the if (#3344)
This commit is contained in:
parent
6e2a2f2b2c
commit
ce0af287f2
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user