mirror of
https://github.com/django/django.git
synced 2025-07-07 19:29: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:
parent
eea2bfd941
commit
3772800752
@ -121,6 +121,8 @@ class Field(object):
|
|||||||
raise ValidationError(self.error_messages['required'])
|
raise ValidationError(self.error_messages['required'])
|
||||||
|
|
||||||
def run_validators(self, value):
|
def run_validators(self, value):
|
||||||
|
if value in validators.EMPTY_VALUES:
|
||||||
|
return
|
||||||
errors = []
|
errors = []
|
||||||
for v in self.validators:
|
for v in self.validators:
|
||||||
# don't run complex validators since they need all_values
|
# don't run complex validators since they need all_values
|
||||||
|
Loading…
x
Reference in New Issue
Block a user