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:
parent
cddf794105
commit
62288e3929
@ -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
|
||||
}
|
@ -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):
|
||||
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user