From 62288e3929bf44e7909d8bc98a0ac4aa8cef128b Mon Sep 17 00:00:00 2001 From: Automated Action Date: Fri, 16 May 2025 02:23:45 +0000 Subject: [PATCH] Fix application startup error by adding email-validator - Add email-validator package to requirements.txt - Update User and Todo schemas to use new Pydantic v2 model_config syntax - Replace deprecated 'orm_mode' with Pydantic v2 'from_attributes' config --- app/schemas/todo.py | 6 +++--- app/schemas/user.py | 6 +++--- requirements.txt | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/schemas/todo.py b/app/schemas/todo.py index 05fbba1..2d2eff5 100644 --- a/app/schemas/todo.py +++ b/app/schemas/todo.py @@ -26,6 +26,6 @@ class Todo(TodoBase): created_at: datetime updated_at: Optional[datetime] = None - class Config: - orm_mode = True - from_attributes = True \ No newline at end of file + model_config = { + "from_attributes": True + } \ No newline at end of file diff --git a/app/schemas/user.py b/app/schemas/user.py index abe8f36..8ca513d 100644 --- a/app/schemas/user.py +++ b/app/schemas/user.py @@ -26,9 +26,9 @@ class User(UserBase): created_at: datetime updated_at: Optional[datetime] = None - class Config: - orm_mode = True - from_attributes = True + model_config = { + "from_attributes": True + } class UserInDB(User): diff --git a/requirements.txt b/requirements.txt index b65791a..79dc968 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,5 @@ python-multipart==0.0.6 ruff==0.1.1 python-jose[cryptography]==3.3.0 passlib[bcrypt]==1.7.4 -pydantic-settings==2.0.3 \ No newline at end of file +pydantic-settings==2.0.3 +email-validator==2.0.0 \ No newline at end of file