-
-
Notifications
You must be signed in to change notification settings - Fork 105
Closed
Description
In 2.7.0 get_field_value returns the field_name instead of the env name, we depended on this logic, but now it makes it really hard to figure out which environment variable was used.
Can we have the env_name added back to EnvSettingsSource to look up the value?
I can see why the change was made, and it makes sense, but we are loosing data with it. We were using it to give feedback for users to track each configuration's value's source. eg.: conf.value1 -> $MY_ENVVAR, conf.value2 -> .env/VALUE2, etc...
Code block in question:
for field_key, env_name, value_is_complex in field_infos:
env_val = self.env_vars.get(env_name)
if env_val is not None:
if value_is_complex or (self.config.get('populate_by_name', False) and (field_key == field_name)):
preferred_key = field_key
break
return env_val, preferred_key, value_is_complex
We are also fine if env_name is saved somewhere inside the class to lookup later.
Metadata
Metadata
Assignees
Labels
No labels