# HG changeset patch # User Daniel Hans # Date 1256937874 -3600 # Node ID 1b9c554ca96dace5baa933006bba2c829f120385 # Parent 1e01ffe9cc610348026c3549607f9590d06752c7 Multiple choice nonrequired questions now accept empty answers. The change is mostly concerned with issue 674, probably fixing it. diff -r 1e01ffe9cc61 -r 1b9c554ca96d app/soc/views/helper/surveys.py --- a/app/soc/views/helper/surveys.py Fri Oct 30 12:40:56 2009 +0100 +++ b/app/soc/views/helper/surveys.py Fri Oct 30 22:24:34 2009 +0100 @@ -803,6 +803,14 @@ def __init__(self, *args, **kwargs): super(PickManyField, self).__init__(*args, **kwargs) + def clean(self, value): + """Validates that the input is a list or tuple. If no fields are marked, + an empty string is returned istead of an empty list. + """ + + value = super(PickManyField, self).clean(value) + return value if value else '' + class PickQuantField(forms.ChoiceField): """Stub for customizing the choice field.