Change email field from EmailStr to str to allow .local domains

This commit is contained in:
2026-01-28 15:14:04 +11:00
parent b2a9b7ea04
commit 3f73ead13f

View File

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