Opened 15 years ago

Closed 14 years ago

#13811 closed (fixed)

Unique checks in model formsets do not ignore null values

Reported by: Claude Paroz Owned by: nobody
Component: Forms Version: 1.2
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

When you have unique_together constraints in which one member can be null, the constraint should not be enforced (as it is correctly done at the model level). Unfortunately, this fails at the formset validation. I think this is a regression in 1.2.

Attachments (2)

formset_validation.diff (1.1 KB ) - added by Claude Paroz 15 years ago.
Ignore when any unique constraint member is None
formset_validation_tests.diff (3.6 KB ) - added by Claude Paroz 15 years ago.
Complementary test for this issue

Download all attachments as: .zip

Change History (3)

by Claude Paroz, 15 years ago

Attachment: formset_validation.diff added

Ignore when any unique constraint member is None

by Claude Paroz, 15 years ago

Complementary test for this issue

comment:1 by Honza Král, 14 years ago

Resolution: fixed
Status: newclosed

(In [14193]) Fixed #13811 -- Changed unique validation in model formsets to ignore None values, not just omit them

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