Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

None behaviour #803

Merged
merged 18 commits into from Sep 18, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

fix coverage

  • Loading branch information
samuelcolvin committed Sep 16, 2019
commit c474ea8608f402448c36ee608791d96936b63294
@@ -229,11 +229,10 @@ def validate(cls, value: Any) -> Any:
except errors.StrError:
raise errors.PyObjectError(error_message='value is neither a valid import path not a valid callable')

if value is not None:
try:
return import_string(value)
except ImportError as e:
raise errors.PyObjectError(error_message=str(e))
try:
return import_string(value)
except ImportError as e:
raise errors.PyObjectError(error_message=str(e))


class ConstrainedNumberMeta(type):
@@ -47,8 +47,6 @@ def str_validator(v: Any) -> Optional[str]:
return v.value
else:
return v
elif v is None:
return None
elif isinstance(v, (float, int, Decimal)):
# is there anything else we want to add here? If you think so, create an issue.
return str(v)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.