sloria/marshmallow — pull request #25 by asteinlein (2014-06-20 17:32:20+00:00)
Title: Move required validation to avoid custom validation messages overriding required message

When having a custom validator with a custom error message, this error message would be used even if the validation failed due to required field validation error. The same applies for built-in fields where you want custom error messages as well, for instance:

```python
email = fields.Email(required=True, error='Invalid email address. Try again.')
```
When validating this without supplying a value for the field, the message "'Invalid email address. Try again." is the one used, while I would expect a message about the missing required value (as is common in forms -- required fields is usually a message separate from invalid input).

To solve this, some refactoring was needed, moving the required validation to validated(), which I feel is a more correct location for validation anyhow. This also led to some cleanup of where validated() is wrapped.

Finally, the required validation error message is changed to what I feel better resembles the other messages in the library: The error dictionary already contains the field name as the key, so it is redundant to repeat it in the message (and consistent with other error messages).

Please let me know if you have any input or questions. Updated tests and docs included. We would love to have this merged so we can avoid using our own fork in production. :)