Skip to content

Commit

Permalink
Removing .directory. Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
0xDCA committed Jan 6, 2015
1 parent bbb3c96 commit cb17377
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
6 changes: 0 additions & 6 deletions .directory

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ pylintrc
# Virtualenvs
env
venv

# Other
.directory

9 changes: 3 additions & 6 deletions marshmallow/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,7 @@ def __init__(self, default=None, attribute=None, error=None,
self.validators = []
else:
raise ValueError("The 'validate' parameter must be a callable "
'or a collection of callables.')

if not (isinstance(required, bool) or isinstance(required, basestring)):
raise ValueError("The 'required' parameter must be a string or a bool")
"or a collection of callables.")

self.required = required
self.metadata = metadata
Expand Down Expand Up @@ -462,8 +459,8 @@ def deserialize(self, value):
def do_deserialization():
if value is missing:
if hasattr(self, 'required') and self.required:
message = self.required if isinstance(self.required, basestring) else \
'Missing data for required field.'
message = (self.required if isinstance(self.required, basestring) else
'Missing data for required field.')
raise ValidationError(message)
output = self._deserialize(value)
self._validate(output)
Expand Down

0 comments on commit cb17377

Please sign in to comment.