Skip to content

Commit

Permalink
more tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Sep 18, 2019
1 parent 18e9743 commit fb9d58c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pydantic/errors.py
Expand Up @@ -4,6 +4,7 @@

from .typing import AnyType, display_as_type

# explicitly state exports to avoid "from .errors import *" also importing Decimal, Path etc.
__all__ = (
'PydanticTypeError',
'PydanticValueError',
Expand Down
2 changes: 1 addition & 1 deletion pydantic/main.py
Expand Up @@ -712,7 +712,7 @@ def validate_model( # noqa: C901 (ignore complexity)
else:
value = deepcopy(field.default)

if not model.__config__.validate_all and not field.validate_always:
if not config.validate_all and not field.validate_always:
values[name] = value
continue
else:
Expand Down
2 changes: 1 addition & 1 deletion pydantic/validators.py
Expand Up @@ -43,7 +43,7 @@

def str_validator(v: Any) -> Optional[str]:
if isinstance(v, str):
if hasattr(v, 'value') and isinstance(v, Enum):
if isinstance(v, Enum):
return v.value
else:
return v
Expand Down

0 comments on commit fb9d58c

Please sign in to comment.