Skip to content

Commit

Permalink
Provide clearer example of how to migrate properties to config
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMadBug committed Sep 13, 2023
1 parent c526916 commit dff58b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion variantgrid/settings/components/secret_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ def get_secret(key: str, mandatory: bool = True) -> Optional[Any]:
value, found = _get_nested(parts, _default_settings)
if found:
if key != 'DB.port':
logging.warning(f"Warning '{key}' not present in config file '{_settings_file()}', using default value '{found}', please migrate")
root_json = value
for p in reversed(parts):
root_json = {p: root_json}
root_json_str = json.dumps(root_json)
logging.warning(f"Warning '{key}' not present in config file '{_settings_file()}', using default value '{found}', please migrate e.g. {root_json_str}")
return value

if not mandatory:
Expand Down

0 comments on commit dff58b0

Please sign in to comment.