Opened 9 years ago

Closed 9 years ago

#3131 closed defect (duplicate)

[patch] MultipleChoiceFields fail to validate for newforms

Reported by: ben <ben.dean.kawamura@…> Owned by: adrian
Component: Forms Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Validation fails when using the SelectMultiple widgets (the default) because value_from_datadict always returns a single value instead of a list.

Attachments (1)

select-multiple.diff (579 bytes) - added by ben <ben.dean.kawamura@…> 9 years ago.
patch

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by ben <ben.dean.kawamura@…>

patch

comment:1 Changed 9 years ago by Massimiliano Ravelli

  • Summary changed from MultipleChoiceFields fail to validate for newforms to [patch] MultipleChoiceFields fail to validate for newforms

Ben explained the defect much better than me (#3129).

In that ticket there's a little patch with a couple of tests.

I'm going to close #3129 and attach here the tests. What do you think about that ?

I changed the title to make evident there is a patch with Ben's solution.

comment:2 Changed 9 years ago by fy@…

I confirm this, had same problem with MultipleChoiceField, patch fixes it.

comment:3 Changed 9 years ago by Massimiliano Ravelli <massimiliano.ravelli@…>

Hi Ben, I tested your patch !
It works with QueryDict and MultiValueDict but doesn't work with normal dict.
A couple of regression test is failing.

In #3114 there is a patch that fixes the problem and passes all tests.
It passes the tests attached in #3129 too.

I suggest you to close this one as duplicate of #3114.

comment:4 Changed 9 years ago by adrian

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #3114, which has been fixed.

Note: See TracTickets for help on using tickets.
Back to Top