Opened 7 years ago

Closed 7 years ago

#7024 closed (duplicate)

ModelForm initial value is handled wrong

Reported by: Martín Conte Mac Donell <Reflejo@…> Owned by: nobody
Component: contrib.admin Version: newforms-admin
Severity: Keywords: initial
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When add_view is called with some initial value (when request.GET isn't null); add_view is instancing ModelForm with initial=request.GET which is wrong since values of QueryDict are list.

Actually BaseForm is trying to find something like [u'value'] in DB.

I think it should be a dictionary instead. (see patch below)

Attachments (1)

newforms-admin.patch (659 bytes) - added by Martín Conte Mac Donell <Reflejo@…> 7 years ago.

Download all attachments as: .zip

Change History (2)

Changed 7 years ago by Martín Conte Mac Donell <Reflejo@…>

comment:1 Changed 7 years ago by brosner

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

Duplicate of #6938. Please search Trac before opening a new ticket. Thanks :)

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