From a46b44fcec70e3fc415f20b19708ebe673f492c3 Mon Sep 17 00:00:00 2001 From: Automated Action Date: Wed, 14 May 2025 01:22:25 +0000 Subject: [PATCH] Fix pydantic error by adding ClassVar type annotation to DB_DIR generated with BackendIM... (backend.im) --- app/core/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/core/config.py b/app/core/config.py index 5b93d85..a34669e 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional, Union +from typing import List, Optional, Union, ClassVar from pathlib import Path from pydantic import AnyHttpUrl, validator from pydantic_settings import BaseSettings @@ -6,7 +6,7 @@ from pydantic_settings import BaseSettings class Settings(BaseSettings): API_V1_STR: str = "/api/v1" PROJECT_NAME: str = "Quick REST API Service" - + # CORS settings BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = [] @@ -19,7 +19,7 @@ class Settings(BaseSettings): raise ValueError(v) # Database settings - 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"