Change email field from EmailStr to str to allow .local domains
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
"""User schemas."""
|
||||
from pydantic import BaseModel, EmailStr
|
||||
from pydantic import BaseModel, Field
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
class UserBase(BaseModel):
|
||||
"""Base user schema."""
|
||||
username: str
|
||||
email: EmailStr
|
||||
email: str # Changed from EmailStr to allow .local domains for home networks
|
||||
full_name: Optional[str] = None
|
||||
|
||||
class UserCreate(UserBase):
|
||||
@@ -15,7 +15,7 @@ class UserCreate(UserBase):
|
||||
|
||||
class UserUpdate(BaseModel):
|
||||
"""Schema for updating a user."""
|
||||
email: Optional[EmailStr] = None
|
||||
email: Optional[str] = None
|
||||
full_name: Optional[str] = None
|
||||
password: Optional[str] = None
|
||||
is_active: Optional[bool] = None
|
||||
|
||||
Reference in New Issue
Block a user