mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-21 21:15:13 +00:00
Fix custom email model return type (#1145)
This commit is contained in:
@@ -14,7 +14,7 @@ class CustomEmailStr(EmailStr):
|
||||
"""自定义邮箱类型"""
|
||||
|
||||
@classmethod
|
||||
def _validate(cls, input_value: str, /) -> str:
|
||||
def _validate(cls, input_value: str, /) -> str | None:
|
||||
return None if not input_value else validate_email(input_value)[1]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user