Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
hotfix/59 fix settings class (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegYurchik authored Oct 1, 2023
2 parents 7426769 + fa3f0e9 commit 20ef526
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 3 additions & 1 deletion sapphire/projects/settings.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from pydantic import AnyUrl, conint
from pydantic_settings import BaseSettings
from pydantic_settings import BaseSettings, SettingsConfigDict


class ProjectsSettings(BaseSettings):
model_config = SettingsConfigDict()

port: conint(ge=1, le=65535) = 8000
root_path: str = ""

Expand Down
8 changes: 3 additions & 5 deletions sapphire/users/settings.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from pydantic import AnyUrl, conint
from pydantic_settings import BaseSettings
from pydantic_settings import BaseSettings, SettingsConfigDict


class UsersSettings(BaseSettings):
model_config = SettingsConfigDict(secrets_dir="/run/secrets")

port: conint(ge=1, le=65535) = 8000
root_path: str = ""

Expand All @@ -11,10 +13,6 @@ class UsersSettings(BaseSettings):
habr_oauth2_client_id: str
habr_oauth2_client_secret: str

class ConfigDict:
case_sensitive = False
secrets_dir = "/run/secrets"


def get_settings() -> UsersSettings:
return UsersSettings()

0 comments on commit 20ef526

Please sign in to comment.