From 0def695e3cbaa9ede9ae4040a24cfed7417f9065 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Mon, 22 Dec 2025 17:16:44 -0500 Subject: [PATCH 1/4] Refs #27100 -- Removed obsolete message from tutorial and migrations topic. The project state is cached, so when it was calculated in #27100 during the pre-migrate stage, it was no longer calculated on forward migrations. Backward migrations still calculate it. --- docs/intro/tutorial02.txt | 1 - docs/topics/migrations.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/docs/intro/tutorial02.txt b/docs/intro/tutorial02.txt index 23bf6c4c94dc..8f99965a47e8 100644 --- a/docs/intro/tutorial02.txt +++ b/docs/intro/tutorial02.txt @@ -308,7 +308,6 @@ database: Operations to perform: Apply all migrations: admin, auth, contenttypes, polls, sessions Running migrations: - Rendering model states... DONE Applying polls.0001_initial... OK The :djadmin:`migrate` command takes all the migrations that haven't been diff --git a/docs/topics/migrations.txt b/docs/topics/migrations.txt index 90034b0dfeed..f68f512cdd35 100644 --- a/docs/topics/migrations.txt +++ b/docs/topics/migrations.txt @@ -135,7 +135,6 @@ database to make sure they work as expected: Operations to perform: Apply all migrations: books Running migrations: - Rendering model states... DONE Applying books.0003_auto... OK Once the migration is applied, commit the migration and the models change From 84bae9c22a8ae7663c56cce5e0c611ea7c17fce1 Mon Sep 17 00:00:00 2001 From: guro-Ishiguro Date: Tue, 23 Dec 2025 00:30:05 +0900 Subject: [PATCH 2/4] Fixed #36818 -- Ensured SQLite connection before accessing max_query_params. Regression in 358fd21c47cdf7bda520ce73c5cfd82bba57827b. --- django/db/backends/sqlite3/features.py | 1 + docs/releases/6.0.1.txt | 4 ++++ tests/backends/sqlite/test_features.py | 11 +++++++++++ 3 files changed, 16 insertions(+) diff --git a/django/db/backends/sqlite3/features.py b/django/db/backends/sqlite3/features.py index 668a53928dd6..ed24341b5e6c 100644 --- a/django/db/backends/sqlite3/features.py +++ b/django/db/backends/sqlite3/features.py @@ -157,6 +157,7 @@ def max_query_params(self): 32766) or lowered per connection at run-time with setlimit(SQLITE_LIMIT_VARIABLE_NUMBER, N). """ + self.connection.ensure_connection() return self.connection.connection.getlimit(sqlite3.SQLITE_LIMIT_VARIABLE_NUMBER) @cached_property diff --git a/docs/releases/6.0.1.txt b/docs/releases/6.0.1.txt index 36e533a88871..15805124099a 100644 --- a/docs/releases/6.0.1.txt +++ b/docs/releases/6.0.1.txt @@ -20,3 +20,7 @@ Bugfixes * Fixed a bug where management command colorized help (introduced in Python 3.14) ignored the :option:`--no-color` option and the :envvar:`DJANGO_COLORS` setting (:ticket:`36376`). + +* Fixed a regression in Django 6.0 that caused + :meth:`~django.db.models.query.QuerySet.bulk_create` to crash + when introspecting the connection on SQLite (:ticket:`36818`). diff --git a/tests/backends/sqlite/test_features.py b/tests/backends/sqlite/test_features.py index 95e060fbccea..45c3ec9f2c95 100644 --- a/tests/backends/sqlite/test_features.py +++ b/tests/backends/sqlite/test_features.py @@ -1,3 +1,4 @@ +import copy import sqlite3 from unittest import mock, skipUnless @@ -29,3 +30,13 @@ def test_max_query_params_respects_variable_limit(self): finally: connection.connection.setlimit(limit_name, current_limit) self.assertEqual(connection.features.max_query_params, current_limit) + + def test_max_query_params_without_established_connection(self): + new_connection = connection.copy() + new_connection.settings_dict = copy.deepcopy(connection.settings_dict) + self.assertIsNone(new_connection.connection) + try: + result = new_connection.features.max_query_params + self.assertIsInstance(result, int) + finally: + new_connection._close() From 968f3f96373e028f1486d135e38331fcd0e3a0ca Mon Sep 17 00:00:00 2001 From: Nilesh Kumar Pahari Date: Tue, 23 Dec 2025 03:53:18 +0530 Subject: [PATCH 3/4] Refs #36806 -- Removed unnecessary null=True from GeneratedField in test models. Test coverage is preserved because the tests only verify that generated fields can produce NULL values when the source field is nullable. This addresses system check warnings in the test suite after 6025eab3c509b4de922117e16866bbfe0ee99aa6. --- tests/model_fields/models.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/model_fields/models.py b/tests/model_fields/models.py index 800a9ff5aa81..cdf3c00080c9 100644 --- a/tests/model_fields/models.py +++ b/tests/model_fields/models.py @@ -636,7 +636,6 @@ class GeneratedModelNull(models.Model): expression=Lower("name"), output_field=models.CharField(max_length=10), db_persist=True, - null=True, ) class Meta: @@ -649,7 +648,6 @@ class GeneratedModelNullVirtual(models.Model): expression=Lower("name"), output_field=models.CharField(max_length=10), db_persist=False, - null=True, ) class Meta: From 1eac2659a102d42490f9401b08782633fa51f3e3 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Wed, 17 Dec 2025 09:27:01 -0500 Subject: [PATCH 4/4] Fixed #36807 -- Fixed form field alignment under
in the admin. It isn't safe to set display: flex on
, because on Safari this interferes with display: block on child divs. Thanks Paulo Coutinho for the report and Antoliny for the review. Regression in 4187da258fe212d494cb578a0bc2b52c4979ab95. --- django/contrib/admin/static/admin/css/forms.css | 8 ++------ django/contrib/admin/static/admin/css/responsive.css | 4 ++++ .../admin/templates/admin/auth/user/change_password.html | 2 +- .../contrib/admin/templates/admin/includes/fieldset.html | 2 +- docs/releases/6.0.1.txt | 3 +++ tests/auth_tests/test_views.py | 3 +-- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/django/contrib/admin/static/admin/css/forms.css b/django/contrib/admin/static/admin/css/forms.css index 76e2d493e9dd..6d13d433500e 100644 --- a/django/contrib/admin/static/admin/css/forms.css +++ b/django/contrib/admin/static/admin/css/forms.css @@ -102,7 +102,7 @@ fieldset .inline-heading, } .aligned legend { - float: left; + float: inline-start; } .aligned legend, @@ -148,15 +148,11 @@ form .aligned ul { } form .aligned div.radiolist { - display: inline-block; + display: block; margin: 0; padding: 0; } -form .aligned fieldset div.help { - margin-left: 0; -} - form .aligned p.help, form .aligned div.help { margin-top: 0; diff --git a/django/contrib/admin/static/admin/css/responsive.css b/django/contrib/admin/static/admin/css/responsive.css index fbf0d88b4028..93abf79953c3 100644 --- a/django/contrib/admin/static/admin/css/responsive.css +++ b/django/contrib/admin/static/admin/css/responsive.css @@ -560,6 +560,10 @@ input[type="submit"], button { margin-top: 5px; } + form .aligned fieldset div.flex-container { + display: unset; + } + /* Related widget */ .related-widget-wrapper { diff --git a/django/contrib/admin/templates/admin/auth/user/change_password.html b/django/contrib/admin/templates/admin/auth/user/change_password.html index 08d191b765e4..d3e546d28d89 100644 --- a/django/contrib/admin/templates/admin/auth/user/change_password.html +++ b/django/contrib/admin/templates/admin/auth/user/change_password.html @@ -40,7 +40,7 @@
{{ form.usable_password.errors }} -
{{ form.usable_password.legend_tag }} {{ form.usable_password }}
+
{{ form.usable_password.legend_tag }} {{ form.usable_password }}
{% if form.usable_password.help_text %}

{{ form.usable_password.help_text|safe }}

diff --git a/django/contrib/admin/templates/admin/includes/fieldset.html b/django/contrib/admin/templates/admin/includes/fieldset.html index aa8d94b41d30..1fd303ea823e 100644 --- a/django/contrib/admin/templates/admin/includes/fieldset.html +++ b/django/contrib/admin/templates/admin/includes/fieldset.html @@ -11,7 +11,7 @@
{% if line.fields|length == 1 %}{{ line.errors }}{% else %}
{% endif %} {% for field in line %} - {% if field.is_fieldset %}
{{ field.label_tag }}{% endif %} + {% if field.is_fieldset %}{{ field.label_tag }}{% endif %}
{% if not line.fields|length == 1 and not field.is_readonly %}{{ field.errors }}{% endif %}
diff --git a/docs/releases/6.0.1.txt b/docs/releases/6.0.1.txt index 15805124099a..790fa76e997e 100644 --- a/docs/releases/6.0.1.txt +++ b/docs/releases/6.0.1.txt @@ -24,3 +24,6 @@ Bugfixes * Fixed a regression in Django 6.0 that caused :meth:`~django.db.models.query.QuerySet.bulk_create` to crash when introspecting the connection on SQLite (:ticket:`36818`). + +* Fixed a visual regression in Django 6.0 for admin form fields grouped under a + ``
`` in Safari (:ticket:`36807`). diff --git a/tests/auth_tests/test_views.py b/tests/auth_tests/test_views.py index a3863b6233c0..d7d59d9fc033 100644 --- a/tests/auth_tests/test_views.py +++ b/tests/auth_tests/test_views.py @@ -1555,8 +1555,7 @@ def test_user_with_usable_password_change_password(self): # Usable password field. self.assertContains( response, - '
' - "Password-based authentication:", + "
Password-based authentication:", ) # Submit buttons self.assertContains(response, '