mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
tweak email-validator import error message (#145)
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
History
|
||||
-------
|
||||
|
||||
v0.8.1 (2018-XX-XX)
|
||||
...................
|
||||
* tweak email-validator import error message #145
|
||||
|
||||
v0.8.0 (2018-03-25)
|
||||
...................
|
||||
* fix type annotation for ``inherit_config`` #139
|
||||
|
||||
+2
-2
@@ -82,7 +82,7 @@ class EmailStr(str):
|
||||
def get_validators(cls):
|
||||
# included here and below so the error happens straight away
|
||||
if email_validator is None:
|
||||
raise ImportError('email-validator is not installed, run `pip install email-validator`')
|
||||
raise ImportError('email-validator is not installed, run `pip install pydantic[email]`')
|
||||
yield str_validator
|
||||
yield cls.validate
|
||||
|
||||
@@ -101,7 +101,7 @@ class NameEmail:
|
||||
@classmethod
|
||||
def get_validators(cls):
|
||||
if email_validator is None:
|
||||
raise ImportError('email-validator is not installed, run `pip install email-validator`')
|
||||
raise ImportError('email-validator is not installed, run `pip install pydantic[email]`')
|
||||
yield str_validator
|
||||
yield cls.validate
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ def validate_email(value) -> Tuple[str, str]:
|
||||
See RFC 5322 but treat it with suspicion, there seems to exist no universally acknowledged test for a valid email!
|
||||
"""
|
||||
if email_validator is None:
|
||||
raise ImportError('email-validator is not installed, run `pip install email-validator`')
|
||||
raise ImportError('email-validator is not installed, run `pip install pydantic[email]`')
|
||||
|
||||
m = PRETTY_REGEX.fullmatch(value)
|
||||
if m:
|
||||
|
||||
Reference in New Issue
Block a user