Commits

Anonymous committed 2c577ad

Fixed handling of single choice poll results.

If the poll had only 1 choice, then a RadioSelect widget would be used, which
returned a single unicode instance instead of list of poll option IDs.

This resulted in erroneous "You have selected too many choices! (Only 1
allowed.)" error.

  • Participants
  • Parent commits e6f96a6

Comments (0)

Files changed (1)

djangobb_forum/forms.py

 
     def clean_choice(self):
         ids = self.cleaned_data["choice"]
+        if not isinstance(ids, list):
+            ids = [ids]
         count = len(ids)
         if count > self.poll.choice_count:
             raise forms.ValidationError(