From b763a44328474c986795fa39fff739887437ff73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 10 Dec 2018 17:49:39 +0400 Subject: [PATCH] :bug: Fix import of email_validator from Pydantic --- fastapi/__init__.py | 2 +- fastapi/openapi/models.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fastapi/__init__.py b/fastapi/__init__.py index 2ee3cdd2e..d27c0eab7 100644 --- a/fastapi/__init__.py +++ b/fastapi/__init__.py @@ -1,6 +1,6 @@ """FastAPI framework, high performance, easy to learn, fast to code, ready for production""" -__version__ = "0.1.3" +__version__ = "0.1.4" from .applications import FastAPI from .routing import APIRouter diff --git a/fastapi/openapi/models.py b/fastapi/openapi/models.py index 87eed07be..eb49dc96b 100644 --- a/fastapi/openapi/models.py +++ b/fastapi/openapi/models.py @@ -6,13 +6,13 @@ from pydantic import BaseModel, Schema as PSchema from pydantic.types import UrlStr try: - import pydantic.types.EmailStr + import email_validator from pydantic.types import EmailStr # type: ignore except ImportError: logging.warning( - "email-validator not installed, email fields will be treated as str" + "email-validator not installed, email fields will be treated as str.\n" + + "To install, run: pip install email-validator" ) - class EmailStr(str): # type: ignore pass