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:
Ítalo Johnny 2024-10-19 18:10:49 -03:00 committed by GitHub
commit 4d7653c451
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -189,6 +189,13 @@ class Settings(BaseSettings):
logger.debug(f"Setting user agent to {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")
@classmethod
def set_log_file(cls, value):