Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made use of `EMPTY_VALUES` in `ModelChoiceField.clean()`.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6699 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 42c5a91388832b001321f2eb46c939eadc117b08 1 parent 66576c2
@gdub gdub authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/newforms/models.py
View
4 django/newforms/models.py
@@ -9,7 +9,7 @@
from util import ValidationError
from forms import BaseForm
-from fields import Field, ChoiceField
+from fields import Field, ChoiceField, EMPTY_VALUES
from widgets import Select, SelectMultiple, MultipleHiddenInput
__all__ = (
@@ -200,7 +200,7 @@ def _set_choices(self, value):
def clean(self, value):
Field.clean(self, value)
- if value in ('', None):
+ if value in EMPTY_VALUES:
return None
try:
value = self.queryset.get(pk=value)
Please sign in to comment.
Something went wrong with that request. Please try again.