MultipleChoice fields don't validate when using request.REQUEST
| Reported by: |
Daniel Roseman <daniel@…> |
Owned by: |
nobody |
|
Component:
|
Forms
|
Version:
|
dev
|
|
Severity:
|
|
Keywords:
|
|
|
Cc:
|
|
Triage Stage:
|
Accepted
|
|
Has patch:
|
yes
|
Needs documentation:
|
no
|
|
Needs tests:
|
no
|
Patch needs improvement:
|
yes
|
|
Easy pickings:
|
no
|
UI/UX:
|
no
|
MultipleChoice fields always give a validation error if you instantiate the form using data from request.REQUEST rather than request.POST.
This is because the SelectMultiple widget only uses the getlist() method if the data dictionary is a MultiValueDict, whereas request.REQUEST is a MergeDict.
Patch and tests attached.
I have one objection about the patch: It always treats a MergeDict like a MultiValueDict. But a MergeDict does not need to be merging MultiValueDicts. If it merges normal dicts, the patch is not appropriate.
Anyway, this is a bug so ==> milestone 1.0