Skip to content

Commit

Permalink
1.8.2-post1: patch f-string in secret key warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
jombooth committed Sep 15, 2023
1 parent 46b3fde commit 6b63ecb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion label_studio/core/utils/secret_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def generate_secret_key_if_missing(data_dir: str) -> str:
with open(env_filepath, 'a') as f:
f.write(f'\n{env_key}={new_secret}\n') # nosec
except Exception as e:
logger.warning(f'Warning: failed to write {env_key} to .env file: {e}, new key will be regenerated on every server restart. If this key is used for signing, it will invalidate all existing sessions or tokens. Please set {key} in your environment variables to avoid this warning.')
logger.warning(f'Warning: failed to write {env_key} to .env file: {e}, new key will be regenerated on every server restart. If this key is used for signing, it will invalidate all existing sessions or tokens. Please set {env_key} in your environment variables to avoid this warning.')

os.environ[env_key] = new_secret
return new_secret

0 comments on commit 6b63ecb

Please sign in to comment.