Skip to content

Commit a093e52

Browse files
authored
Merge pull request #181 from python-ellar/email_str_bug
Fixed EmailStr bug
2 parents 71a3c3b + 90eec87 commit a093e52

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ellar/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
""" Ellar - Python ASGI web framework for building fast, efficient, and scalable RESTful APIs and server-side applications. """
22

3-
__version__ = "0.7.0"
3+
__version__ = "0.7.1"

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)