1
0
mirror of https://github.com/django/django.git synced 2025-07-07 11:19:12 +00:00

[soc2009/model-validation] Do not run simple validators on empty values

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11033 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Honza Král 2009-06-18 00:31:18 +00:00
parent eea2bfd941
commit 3772800752

View File

@ -121,6 +121,8 @@ class Field(object):
raise ValidationError(self.error_messages['required'])
def run_validators(self, value):
if value in validators.EMPTY_VALUES:
return
errors = []
for v in self.validators:
# don't run complex validators since they need all_values