Skip to content

Commit 9a2ed19

Browse files
committed
Bug Fixes: EmailStr pydantic error fixed
1 parent 06a19c6 commit 9a2ed19

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ellar/pydantic/emails.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
from ellar.common.logging import logger
1212

1313
@as_pydantic_validator(
14-
"__validate_input", schema={"type": "string", "format": "email"}
14+
"__validate_input__", schema={"type": "string", "format": "email"}
1515
)
16-
class EmailStr(str): # type: ignore
16+
class FallbackEmailStr(str): # type: ignore
1717
@classmethod
18-
def __validate_input(cls, __input_value: t.Any, _: t.Any) -> str:
18+
def __validate_input__(cls, __input_value: t.Any, _: t.Any) -> str:
1919
logger.warning(
2020
"email-validator not installed, email fields will be treated as str.\n"
2121
"To install, run: pip install email-validator"
2222
)
2323
return str(__input_value)
24+
25+
EmailStr = FallbackEmailStr

0 commit comments

Comments
 (0)