Skip to content

Commit

Permalink
Merge branch 'pr/83' into blank_enum
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesturk committed Feb 19, 2015
2 parents 487fb71 + d28dcfc commit ca40df9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions validictory/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,9 @@ def validate_enum(self, x, fieldname, schema, path, options=None):
raise SchemaError("Enumeration {!r} for field '{}' must be a container".format(
options, fieldname))
if value not in options:
self._error("is not in the enumeration: {options!r}", value, fieldname,
options=options, path=path)
if not(value == '' and schema.get('blank', self.blank_by_default)):
self._error("is not in the enumeration: {options!r}", value, fieldname,
options=options, path=path)

def validate_title(self, x, fieldname, schema, path, title=None):
if not isinstance(title, (_str_type, type(None))):
Expand Down

0 comments on commit ca40df9

Please sign in to comment.