Code

Opened 6 years ago

Closed 6 years ago

#8008 closed (duplicate)

Bug wih SelectMultiple Widget when form is initialized with request.REQUEST dict

Reported by: dimitri Owned by: nobody
Component: Forms Version: 0.96
Severity: Keywords: SelectMultiple REQUEST widgets newforms
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The value_from_datadict() method of the SelectMultiple widget is using an isinstance() method to determine if the dictionary is a MultiValue one.
Since request.REQUEST is a MergeDict, the value_from_datadict method uses a get() method on the dictionary instead of the getlist()

def value_from_datadict(self, data, name):
  if isinstance(data, MultiValueDict):
    return data.getlist(name)
  return data.get(name, None)

Attachments (0)

Change History (1)

comment:1 Changed 6 years ago by mattmcc

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Dup of #7195.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.