Opened 6 years ago

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

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 6 years ago.
Ignore when any unique constraint member is None
formset_validation_tests.diff (3.6 KB) - added by Claude Paroz 6 years ago.
Complementary test for this issue

Download all attachments as: .zip

Change History (3)

Changed 6 years ago by Claude Paroz

Attachment: formset_validation.diff added

Ignore when any unique constraint member is None

Changed 6 years ago by Claude Paroz

Complementary test for this issue

comment:1 Changed 6 years ago by Honza Král

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