mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Fixed #33335 -- Made model validation ignore functional unique constraints.
Regression in 3aa545281e
.
Thanks Hervé Le Roy for the report.
This commit is contained in:
parent
d3a64bea51
commit
1eaf38fa87
4 changed files with 35 additions and 6 deletions
|
@ -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``
|
||||
===================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue