Skip to content

Commit

Permalink
Explicitly use the bool validator in the CheckBox widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Feb 5, 2013
1 parent 9cf7a07 commit 25ff942
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tw2/forms/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ class CheckBox(InputField):

def prepare(self):
super(CheckBox, self).prepare()
checked = self.validator._convert_to_python(self.value)
self.safe_modify('attrs')
self.attrs['checked'] = self.value and 'checked' or None
self.attrs['checked'] = checked and 'checked' or None
self.attrs['value'] = None


Expand Down

0 comments on commit 25ff942

Please sign in to comment.