If you write a test for, say, the bundle form of a patch list, you'd
still have to specify the 'no change' value to other form (e.g. the
multiple update one) fields using MultipleBooleanField or else it'd
raise a ValueError when field.clean() is called as part of
form._get_errors().
Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
return False
def to_python(self, value):
- if self.is_no_change(value):
- return value
+ if value is None or self.is_no_change(value):
+ return self.no_change_choice[0]
elif value == 'True':
return True
elif value == 'False':