Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #4755 -- Modified newforms MultipleChoiceField to use list comp…

…rehension, rather than iteration.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 7f5797e commit a5de16fbe4adbdf960683cbdebea4d4e9db2983d @freakboy3742 freakboy3742 committed
Showing with 1 addition and 4 deletions.
  1. +1 −4 django/newforms/
5 django/newforms/
@@ -446,10 +446,7 @@ def clean(self, value):
return []
if not isinstance(value, (list, tuple)):
raise ValidationError(ugettext(u'Enter a list of values.'))
- new_value = []
- for val in value:
- val = smart_unicode(val)
- new_value.append(val)
+ new_value = [smart_unicode(val) for val in value]
# Validate that each value in the value list is in self.choices.
valid_values = set([smart_unicode(k) for k, v in self.choices])
for val in new_value:

0 comments on commit a5de16f

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