Skip to content
Browse files

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

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 66576c2 commit 42c5a91388832b001321f2eb46c939eadc117b08 @gdub gdub committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/newforms/
4 django/newforms/
@@ -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
value = self.queryset.get(pk=value)

0 comments on commit 42c5a91

Please sign in to comment.
Something went wrong with that request. Please try again.