diff options
| author | Brendan MacDonell <brendan@macdonell.net> | 2012-08-06 10:42:21 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-08-06 10:42:21 +0200 |
| commit | ad237fb72f769bbd99b5ed6e3292bead614e1c94 (patch) | |
| tree | 87846e67a25363fe866a261726467ca774c694d7 /django | |
| parent | 9a3026a920286e9932401300d14f72a85ba03a43 (diff) | |
Fixed #18724 -- Fixed IntegerField validation with value 0
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/fields/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 9606b1b843..de24a24ed1 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -179,7 +179,8 @@ class Field(object): if not self.editable: # Skip validation for non-editable fields. return - if self._choices and value: + + if self._choices and value not in validators.EMPTY_VALUES: for option_key, option_value in self.choices: if isinstance(option_value, (list, tuple)): # This is an optgroup, so look inside the group for |
