From f64c3ea80e3e5a73ae90c5e65275f14c33470318 Mon Sep 17 00:00:00 2001 From: Automated Action Date: Thu, 12 Jun 2025 17:55:57 +0000 Subject: [PATCH] Fix Pydantic v2 non-annotated attribute error in Settings class --- app/core/config.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/core/config.py b/app/core/config.py index 2816146..6f5e859 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -1,6 +1,6 @@ import os from pathlib import Path -from typing import Optional +from typing import Optional, ClassVar from pydantic_settings import BaseSettings @@ -20,7 +20,7 @@ class Settings(BaseSettings): ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 8 # Database - DB_DIR = Path("/app") / "storage" / "db" + DB_DIR: ClassVar[Path] = Path("/app") / "storage" / "db" DB_DIR.mkdir(parents=True, exist_ok=True) SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite" @@ -28,8 +28,9 @@ class Settings(BaseSettings): FIRST_SUPERUSER_EMAIL: Optional[str] = os.getenv("FIRST_SUPERUSER_EMAIL") FIRST_SUPERUSER_PASSWORD: Optional[str] = os.getenv("FIRST_SUPERUSER_PASSWORD") - class Config: - case_sensitive = True + model_config = { + "case_sensitive": True + } settings = Settings()