From 01d5f01c97c7c26de3964b1bafec6672e034400c Mon Sep 17 00:00:00 2001 From: Nargis Sultani Date: Thu, 15 Aug 2024 00:23:50 -0400 Subject: [PATCH] updated init in config to take in .env.local --- src/regtech_user_fi_management/config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/regtech_user_fi_management/config.py b/src/regtech_user_fi_management/config.py index fac386a..3cf2cc1 100644 --- a/src/regtech_user_fi_management/config.py +++ b/src/regtech_user_fi_management/config.py @@ -8,6 +8,7 @@ from regtech_api_commons.oauth2.config import KeycloakSettings from regtech_regex.regex_config import RegexConfigs +from pydantic_settings.sources import DotenvType, ENV_FILE_SENTINEL JWT_OPTS_PREFIX = "jwt_opts_" @@ -28,8 +29,8 @@ class Settings(BaseSettings): admin_scopes: Set[str] = set(["query-groups", "manage-users"]) db_logging: bool = True - def __init__(self, **data): - super().__init__(**data) + def __init__(self, _env_file: DotenvType | None = ENV_FILE_SENTINEL, **data): + super().__init__(_env_file=_env_file, **data) @field_validator("inst_conn", mode="before") @classmethod