From b9df2b74b98b4d63933e8061d3cfc1f6f39eb747 Mon Sep 17 00:00:00 2001 From: David Wobrock Date: Wed, 28 Apr 2021 21:15:26 +0200 Subject: Fixed #32676 -- Prevented migrations from rendering related field attributes when not passed during initialization. Thanks Simon Charette for the implementation idea. --- docs/releases/4.0.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/releases/4.0.txt b/docs/releases/4.0.txt index 831bb9b854..eecbc9e4d8 100644 --- a/docs/releases/4.0.txt +++ b/docs/releases/4.0.txt @@ -387,6 +387,18 @@ custom middleware:: .. _Content-Security-Policy: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy +Migrations autodetector changes +------------------------------- + +The migrations autodetector now uses model states instead of model classes. +Also, migration operations for ``ForeignKey`` and ``ManyToManyField`` fields no +longer specify attributes which were not passed to the fields during +initialization. + +As a side-effect, running ``makemigrations`` might generate no-op +``AlterField`` operations for ``ManyToManyField`` and ``ForeignKey`` fields in +some cases. + Miscellaneous ------------- @@ -422,10 +434,6 @@ Miscellaneous * Tests that fail to load, for example due to syntax errors, now always match when using :option:`test --tag`. -* The migrations autodetector now uses model states instead of model classes. - As a side-effect ``makemigrations`` might generate no-op ``AlterField`` - operations for ``ForeignKey`` fields in some cases. - * The undocumented ``django.contrib.admin.utils.lookup_needs_distinct()`` function is renamed to ``lookup_spawns_duplicates()``. -- cgit v1.3