Skip to content

Commit

Permalink
returning selectfield values need to be list-ized prior to validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
percious committed Nov 3, 2009
1 parent 075e50c commit 0671c3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tw2/forms/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ def _validate(self, value):
validator.
"""
if self.multiple:
self.value = value
if isinstance(value, basestring):
value = [value,]
self.value = value
if self.item_validator:
value = [twc.safe_validate(self.item_validator, v) for v in (value or [])]
value = [v for v in value if v is not twc.Invalid]
Expand Down

0 comments on commit 0671c3a

Please sign in to comment.