Opened 17 years ago

Closed 17 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: no UI/UX: no

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@…> 17 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)

by Simon Litchfield <simon@…>, 17 years ago

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 by anonymous, 17 years ago

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 by korpios, 17 years ago

Resolution: invalid
Status: closedreopened

Anonymous users shouldn't be closing tickets.

comment:3 by jkocherhans, 17 years ago

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