Permalink
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...
1 parent 66576c2 commit 42c5a91388832b001321f2eb46c939eadc117b08 @gdub gdub committed Nov 19, 2007
Showing with 2 additions and 2 deletions.
  1. +2 −2 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)

0 comments on commit 42c5a91

Please sign in to comment.