Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated init in config to take in .env.local #212

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/regtech_user_fi_management/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_"
Expand All @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Realized we don't need this. Because the Settings was already taking in **data, code using Settings can already pass in Settings(_env_file='something') and that will be passed to BaseSettings. Same would go with the KeycloakSettings in commons-api.


@field_validator("inst_conn", mode="before")
@classmethod
Expand Down
Loading