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
This commit is contained in:
Automated Action 2025-05-16 02:23:45 +00:00
parent cddf794105
commit 62288e3929
3 changed files with 8 additions and 7 deletions

View File

@ -26,6 +26,6 @@ class Todo(TodoBase):
created_at: datetime
updated_at: Optional[datetime] = None
class Config:
orm_mode = True
from_attributes = True
model_config = {
"from_attributes": True
}

View File

@ -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):

View File

@ -8,3 +8,4 @@ ruff==0.1.1
python-jose[cryptography]==3.3.0
passlib[bcrypt]==1.7.4
pydantic-settings==2.0.3
email-validator==2.0.0