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
|
created_at: datetime
|
||||||
updated_at: Optional[datetime] = None
|
updated_at: Optional[datetime] = None
|
||||||
|
|
||||||
class Config:
|
model_config = {
|
||||||
orm_mode = True
|
"from_attributes": True
|
||||||
from_attributes = True
|
}
|
@ -26,9 +26,9 @@ class User(UserBase):
|
|||||||
created_at: datetime
|
created_at: datetime
|
||||||
updated_at: Optional[datetime] = None
|
updated_at: Optional[datetime] = None
|
||||||
|
|
||||||
class Config:
|
model_config = {
|
||||||
orm_mode = True
|
"from_attributes": True
|
||||||
from_attributes = True
|
}
|
||||||
|
|
||||||
|
|
||||||
class UserInDB(User):
|
class UserInDB(User):
|
||||||
|
@ -7,4 +7,5 @@ python-multipart==0.0.6
|
|||||||
ruff==0.1.1
|
ruff==0.1.1
|
||||||
python-jose[cryptography]==3.3.0
|
python-jose[cryptography]==3.3.0
|
||||||
passlib[bcrypt]==1.7.4
|
passlib[bcrypt]==1.7.4
|
||||||
pydantic-settings==2.0.3
|
pydantic-settings==2.0.3
|
||||||
|
email-validator==2.0.0
|
Loading…
x
Reference in New Issue
Block a user