Skip to content

Commit

Permalink
Fixes a previous change based on a misconception
Browse files Browse the repository at this point in the history
  • Loading branch information
funkyfuture committed Apr 18, 2017
1 parent e5f92ac commit 1018ac8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions cerberus/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ class and a dictionary, the latter is passed to the
validation of a document's field if return ``True``.
Type: :class:`tuple` """
_valid_schemas = set()
""" A :class:`set` of hashed validation schemas that are legit for a
particular ``Validator`` class. """
""" A :class:`set` of hashed derived from validation schemas that are
legit for a particular ``Validator`` class. """

def __init__(self, *args, **kwargs):
""" The arguments will be treated as with this signature:
Expand Down Expand Up @@ -240,8 +240,7 @@ def _error(self, *args):
else:
field_definitions = self._resolve_rules_set(self.schema[field])
if rule == 'nullable':
constraint = field_definitions.get(rule,
self.ignore_none_values)
constraint = field_definitions.get(rule, False)
else:
constraint = field_definitions[rule]

Expand Down Expand Up @@ -1070,6 +1069,7 @@ def _validate_nullable(self, nullable, field, value):
else:
self._error(field, errors.NOT_NULLABLE)
return True
return False

def _validate_keyschema(self, schema, field, value):
""" {'type': ['dict', 'string'], 'validator': 'bulk_schema',
Expand Down
3 changes: 1 addition & 2 deletions docs/validation-rules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,7 @@ nullable
--------
If ``True`` the field value is allowed to be :obj:`None`. The rule will be
checked on every field, regardless it's defined or not. The rule's constraint
defaults to the :attr:`~cerberus.Validator.ignore_none_values` property of a
:class:`~cerberus.Validator` instance if not defined in the schema.
defaults ``False``.

.. doctest::

Expand Down

0 comments on commit 1018ac8

Please sign in to comment.