1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

[5.1.x] Fixed #35560 -- Made Model.full_clean() ignore GeneratedFields for constraints.

Accessing generated field values on unsaved models caused a crash when
validating CheckConstraints and UniqueConstraints with expressions.

Backport of 1005c2abd1 from main.
This commit is contained in:
Mark Gensler
2024-06-25 15:04:48 +01:00
committed by Sarah Boyce
parent 3b5d04f879
commit 2da007737c
4 changed files with 126 additions and 2 deletions

View File

@@ -10,4 +10,7 @@ issues with severity "low", and several bugs in 5.0.6.
Bugfixes
========
* ...
* Fixed a bug in Django 5.0 that caused a crash of ``Model.full_clean()`` on
unsaved model instances with a ``GeneratedField`` and certain defined
:attr:`Meta.constraints <django.db.models.Options.constraints>`
(:ticket:`35560`).