feat: concat default variables with env values (#4211)
* feat: concat default variables with env values * fix: prevent duplicate env variables
This commit is contained in:
parent
bac14d99c2
commit
4d7653c451
1 changed files with 7 additions and 0 deletions
|
|
@ -189,6 +189,13 @@ class Settings(BaseSettings):
|
||||||
logger.debug(f"Setting user agent to {value}")
|
logger.debug(f"Setting user agent to {value}")
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
@field_validator("variables_to_get_from_environment", mode="before")
|
||||||
|
@classmethod
|
||||||
|
def set_variables_to_get_from_environment(cls, value):
|
||||||
|
if isinstance(value, str):
|
||||||
|
value = value.split(",")
|
||||||
|
return list(set(VARIABLES_TO_GET_FROM_ENVIRONMENT + value))
|
||||||
|
|
||||||
@field_validator("log_file", mode="before")
|
@field_validator("log_file", mode="before")
|
||||||
@classmethod
|
@classmethod
|
||||||
def set_log_file(cls, value):
|
def set_log_file(cls, value):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue