From 9d7be5f6dfcfb5f0bc94e78ec2395006528f871e Mon Sep 17 00:00:00 2001 From: James Polley Date: Sat, 30 Sep 2017 18:11:05 +1000 Subject: [PATCH] Update YesNoField coercion I am not sure if this is related to a py2/py3 change, or if it's because django 1.11 changed the way it handles booleans; but either way, this works. --- pinaxcon/registrasion/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pinaxcon/registrasion/forms.py b/pinaxcon/registrasion/forms.py index b655f11c..7bb21f1e 100644 --- a/pinaxcon/registrasion/forms.py +++ b/pinaxcon/registrasion/forms.py @@ -9,7 +9,7 @@ class YesNoField(forms.TypedChoiceField): kwargs['required'] = True super(YesNoField, self).__init__( *args, - coerce=lambda x: x is True, + coerce=lambda x: x in ['True', 'Yes', True], choices=((None, '--------'), (False, 'No'), (True, 'Yes')), **kwargs )