From 5d4f21b16f002ed5202a68d6977346ccf53b0b0e Mon Sep 17 00:00:00 2001 From: Nick Touran Date: Wed, 4 Aug 2021 13:19:29 -0700 Subject: Fixed #32983 -- Added system check for redundant related_name on symmetrical M2M fields. Since ManyToManyFields defined with `symmetrical=True` do not add a related field to the target model, including a `related_name` argument will never do what the coder likely expects. This makes including a related_name with a symmetrical model raise a system check warning. ticket-32983 --- docs/ref/checks.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/ref') diff --git a/docs/ref/checks.txt b/docs/ref/checks.txt index 3147114f8d..2ea2fd0df2 100644 --- a/docs/ref/checks.txt +++ b/docs/ref/checks.txt @@ -313,6 +313,8 @@ Related fields with a ``through`` model. * **fields.W344**: The field's intermediary table ```` clashes with the table name of ````/``.``. +* **fields.W345**: ``related_name`` has no effect on ``ManyToManyField`` with a + symmetrical relationship, e.g. to "self". Models ------ -- cgit v1.3