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.