Opened 17 years ago
Closed 17 years ago
#5174 closed (duplicate)
Formsets - is_valid() crashes unbound forms
Reported by: | 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)
Change History (4)
by , 17 years ago
Attachment: | formsets-is_valid-5897.diff added |
---|
comment:1 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
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 , 17 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Anonymous users shouldn't be closing tickets.
comment:3 by , 17 years ago
Resolution: | → duplicate |
---|---|
Status: | reopened → closed |
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.
Fixes unbound formsets is_valid() to behave like standard forms - NOTE this patch also includes a patch from ticket 5173