Opened 5 years ago

Closed 5 years ago

#13811 closed (fixed)

Unique checks in model formsets do not ignore null values

Reported by: claudep Owned by: nobody
Component: Forms Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation:
Needs tests: Patch needs improvement:
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 claudep 5 years ago.
Ignore when any unique constraint member is None
formset_validation_tests.diff (3.6 KB) - added by claudep 5 years ago.
Complementary test for this issue

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by claudep

Ignore when any unique constraint member is None

Changed 5 years ago by claudep

Complementary test for this issue

comment:1 Changed 5 years ago by Honza_Kral

  • Resolution set to fixed
  • Status changed from new to closed

(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