From bdc3f9e3508fc144c5e9710f5b672cc41f6e742d Mon Sep 17 00:00:00 2001 From: jkhall81 Date: Mon, 28 Jul 2025 08:59:07 -0700 Subject: [5.2.x] Fixed #36530 -- Extended fields.E347 to check for ManyToManyField involving CompositePrimaryKey on either side. Thanks to Jacob Walls for the report. Backport of 2013092b693be0ebdf36f41dc61615a2de1bbe31 from main. --- docs/ref/checks.txt | 4 ++-- docs/releases/5.2.5.txt | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/ref/checks.txt b/docs/ref/checks.txt index 6f7b7d271e..fd0983dfad 100644 --- a/docs/ref/checks.txt +++ b/docs/ref/checks.txt @@ -338,8 +338,8 @@ Related fields * **fields.W345**: ``related_name`` has no effect on ``ManyToManyField`` with a symmetrical relationship, e.g. to "self". * **fields.W346**: ``db_comment`` has no effect on ``ManyToManyField``. -* **fields.E347**: Field defines a relation to the ``CompositePrimaryKey`` of - model ```` which is not supported. +* **fields.E347**: Field defines a relation involving model ```` which + has a ``CompositePrimaryKey`` and such relations are not supported. Models ------ diff --git a/docs/releases/5.2.5.txt b/docs/releases/5.2.5.txt index 6791983aad..f782ea9632 100644 --- a/docs/releases/5.2.5.txt +++ b/docs/releases/5.2.5.txt @@ -21,3 +21,7 @@ Bugfixes (:ticket:`36518`). * Added compatibility for ``docutils`` 0.22 (:ticket:`36535`). + +* Fixed a crash in Django 5.2 when using a ``ManyToManyField`` on a model with + a composite primary key, by extending the ``fields.E347`` system check + (:ticket:`36530`). -- cgit v1.3