Comment 0 for bug 98491

Revision history for this message
Francis J. Lacoste (flacoste) wrote : TypeError when passing list to

Uploaded: itemswidgets-typerror.patch

When an itemswidget inheriting from SingleDataHelper (like SelectWidget or RadioWidget) receives a list from the request, it fails with a TypeError.

The widget will receive a list instead of a string with handcrafted URLs like: form?field.radio=1&field.radio=1. This can also happen with self-posting forms: some buggy browsers will interpret action="" as including the previous query parameters and will append the new parameters to the old ones, resulting in such a URL being accessed.

I think it would be better if TypeError would be caught and transformed into the appropriate ConversionError.

I'm attaching a patch with test.