Joined May 2011
·

Renne Rocha

Campinas
·
·
·

Posted to Better Way To Initialize Django Forms over 1 year ago

The second code has a bug. If the form contains only checkbox fields, when submitted and none of them are checked, the request.POST variable will be an empty dictionary, evaluated as False.

So, the form will be initialized with None (and consequently unbound). So the is_valid will be always False, even if the form is valid.

Achievements
72 Karma
0 Total ProTip Views