From fed7f992ac8b2ccb5164761a609277513f10d963 Mon Sep 17 00:00:00 2001 From: Hannes Ljungberg Date: Sat, 4 Dec 2021 21:03:38 +0100 Subject: [4.0.x] Fixed #33335 -- Made model validation ignore functional unique constraints. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regression in 3aa545281e0c0f9fac93753e3769df9e0334dbaa. Thanks Hervé Le Roy for the report. Backport of 1eaf38fa87384fe26d1abf6e389d6df1600d4d8c from main --- docs/ref/models/constraints.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/ref/models/constraints.txt b/docs/ref/models/constraints.txt index c675903db6..dd49b1cafc 100644 --- a/docs/ref/models/constraints.txt +++ b/docs/ref/models/constraints.txt @@ -35,10 +35,12 @@ option. not raise ``ValidationError``\s. Rather you'll get a database integrity error on ``save()``. ``UniqueConstraint``\s without a :attr:`~UniqueConstraint.condition` (i.e. non-partial unique constraints) - are different in this regard, in that they leverage the existing - ``validate_unique()`` logic, and thus enable two-stage validation. In - addition to ``IntegrityError`` on ``save()``, ``ValidationError`` is also - raised during model validation when the ``UniqueConstraint`` is violated. + and :attr:`~UniqueConstraint.expressions` (i.e. non-functional unique + constraints) are different in this regard, in that they leverage the + existing ``validate_unique()`` logic, and thus enable two-stage validation. + In addition to ``IntegrityError`` on ``save()``, ``ValidationError`` is + also raised during model validation when the ``UniqueConstraint`` is + violated. ``CheckConstraint`` =================== -- cgit v1.3