Opened 9 years ago

Closed 9 years ago

#5174 closed (duplicate)

Formsets - is_valid() crashes unbound forms

Reported by: Simon Litchfield <simon@…> Owned by: Adrian Holovaty
Component: Forms Version: newforms-admin
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Calling is_valid() on a formset that has no data (unbound) crashes with an attribute error

Attachments (1)

formsets-is_valid-5897.diff (1.4 KB) - added by Simon Litchfield <simon@…> 9 years ago.
Fixes unbound formsets is_valid() to behave like standard forms - NOTE this patch also includes a patch from ticket 5173

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by Simon Litchfield <simon@…>

Attachment: formsets-is_valid-5897.diff added

Fixes unbound formsets is_valid() to behave like standard forms - NOTE this patch also includes a patch from ticket 5173

comment:1 Changed 9 years ago by anonymous

Resolution: invalid
Status: newclosed

Why on earth is_valid() should work for unbound forms? It's meaningless to do that, and that exception was made for purpose.

comment:2 Changed 9 years ago by korpios

Resolution: invalid
Status: closedreopened

Anonymous users shouldn't be closing tickets.

comment:3 Changed 9 years ago by jkocherhans

Resolution: duplicate
Status: reopenedclosed

Duplicate of #4867. It may seem meaningless to call is_valid on an unbound form, but that's how Form behaves. Consistency wins here. If anyone wants to argue that both situations should raise something like an UnboundError, please bring it up on django-dev.

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