Skip to content

Commit

Permalink
Fix: #436
Browse files Browse the repository at this point in the history
  • Loading branch information
Safa Ozturk authored and Safa Ozturk committed Sep 30, 2018
1 parent 7d61ac3 commit effb6a0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cerberus/validator.py
Expand Up @@ -1189,6 +1189,11 @@ def _validate_forbidden(self, forbidden_values, field, value):
elif isinstance(value, int):
if value in forbidden_values:
self._error(field, errors.FORBIDDEN_VALUE, value)
elif isinstance(value, float):
if value in forbidden_values:
self._error(field, errors.FORBIDDEN_VALUE, value)
elif value.is_integer() and int(value) in forbidden_values:
self._error(field, errors.FORBIDDEN_VALUE, value)

def _validate_items(self, items, field, values):
""" {'type': 'list', 'check_with': 'items'} """
Expand Down

0 comments on commit effb6a0

Please sign in to comment.