Repository navigation
Upgrade Django to 6.1.3 - #4858
Merged
Merged
Conversation
Django 6.1 forces a few companion upgrades: - wagtail 7.3.4 -> 8.1: Wagtail 7.3 and 7.4 LTS only support up to Django 6.0; 8.x is the first line supporting 6.1. - wagtail-localize 1.13 -> 1.14.5 for Wagtail 8 / Django 6.1 support. - django-timezone-field 7.0 -> 7.2.2: 7.0 pins Django<6.0. - django-autocomplete-light 3.9.4 -> 4.0.3: 3.9.4 imports django.utils.itercompat, removed in Django 6.0. - django-ses 4.1.1 -> 4.9.0: Django 6.1 support landed in 4.8.0. Add django.contrib.postgres to INSTALLED_APPS: Django 6 raises postgres.E005 for wagtailsearch's SearchVectorField/GinIndex otherwise. Bump the CI postgres service from 14.5 to 18.6 (matching docker-compose; prod RDS runs 18.3): Django 6.1 refuses to connect to PostgreSQL < 15.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
No issues found. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4858 +/- ##
==========================================
+ Coverage 92.43% 92.44% +0.01%
==========================================
Files 360 360
Lines 10938 10938
Branches 949 949
==========================================
+ Hits 10110 10112 +2
+ Misses 706 703 -3
- Partials 122 123 +1 🚀 New features to boost your workflow:
|
dal_admin_filters calls the FK descriptor's get_queryset() with no arguments, but Django 6 requires the `instance` keyword argument, so /admin/voting/vote/ raised a TypeError. dal-admin-filters 1.1.0 is the latest release, so resolve the queryset from the model field instead.
Contributor
|
Upgrades Django 5.2→6.1, Wagtail 7.3→8.1, django-autocomplete-light 3→4, django-ses, django-timezone-field and wagtail-localize. Also moves CI Postgres to 18.6, adds
|
Django 6.1's changelist applies select_related() with the related fields
from list_display instead of an unrestricted select_related(). Calling
.only("conference_id") on that queryset defers `submission` while it is
still being traversed, so the action raised FieldError from the admin.
The test now runs the action on the changelist queryset, which is what the
admin passes to it.
6 of 7 tasks
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades Django from 5.2.18 to 6.1.3, together with the dependency bumps that Django 6.1 requires.
Companion upgrades
wagtailwagtail-localizedjango-timezone-fieldDjango<6.0django-autocomplete-lightdjango.utils.itercompat, which Django 6.0 removed. None of the v4 breaking changes affect us: we only usedal,dal_select2,Select2QuerySetViewanddal_admin_filters.django-sesdjango_ses.SESBackend.Wagtail 8.1 also brings in
django-ninjaandswapper, and bumpsdraftjs-exporterandmodelsearch.Code and config changes
django.contrib.postgrestoINSTALLED_APPS. Without it, Django 6 raisespostgres.E005for wagtailsearch'sSearchVectorField/GinIndex./admin/voting/vote/.dal-admin-filters(1.1.0, the latest release) callsForwardManyToOneDescriptor.get_queryset()with no arguments, but Django 6 requiresinstance=.SubmissionFilternow resolves the queryset from the model field. Regression test:test_vote_changelist_filters_by_submission.mark_speakers_to_receive_vouchersadmin action (FieldError). Django 6.1 changelists now applyselect_related()with only the related fields fromlist_display, where 5.2 used a bareselect_related(). The action called.only("conference_id")on that queryset, which deferssubmissionwhile it is still being traversed. The existing test now runs the action on the changelist queryset, which is what the admin passes to actions.14.5→18.6inbackend-test.ymlandclaude.yml. Django 6.1 refuses to connect to PostgreSQL < 15. This matches docker-compose (18.6), and prod RDS already runs 18.3.Deploy notes
wagtailadmin.0006_formstatewagtailcore.0098_apitokenwagtailsearch.0010_add_text_fields, which adds twoNOT NULLtext columns to the search index table. Its raw SQL only runs on rollback.WAGTAILIMAGES_FORMAT_CONVERSIONS.WAGTAIL_I18N_ENABLED. We don't usewagtail.contrib.sitemaps, so this doesn't affect us.I grepped the codebase for APIs that Django 6.0/6.1 and Wagtail 8.0/8.1 removed or changed and found no usages.
Follow-ups (not in this PR)
The upgrade adds new
RemovedInDjango2028Warnings to the test run:EMAIL_BACKEND→MAILERSsetting migrationget_connection()/connection=innotifications/tasks.pyThese need a separate change to the SES email path. There is also a warning from
django-taggitinternals (quote_name_unless_alias). We can't fix that one yet because Wagtail 8.1 capsdjango-taggit<7.Test plan
manage.py check: no errors. The remaining warnings (fields.E010on I18n fields,staticfiles.W004) were already there.manage.py makemigrations --check: no changesmanage.py graphql_schema:schema.graphqlunchanged/cms-admin/api/explorer/endpoint), page editor + preview panel, images, documents, snippets, site settings, locales, redirects, forms, workflows, reports: all render.title_textcolumn.itlocale synced from English, submitted the page for translation, machine-translated it (OpenAI), and published it in Italian.cmsPagereturns both the English and the Italian content over GraphQL.filter_horizontalfield and split datetimes. Edited the deadlines: changed one, deleted one, and added one with "Add another". Both deadline validation errors render. The schedule builder, grants summary and video-mapping pages load. The clone action ran through the Resonate workflow on a worker running Django 6.1.\r\nnewlines from textareas, both of which also happen on 5.2.delete_selected, including the "protected objects" page.mark_as_failedand the tag form. I skipped the actions that call Pretix or YouTube.Existing bugs found while testing (they also happen on
mainwith Django 5.2 and are not changed by this PR)All of these are fixed in #4859.
RecursionError.Grant.__init__readsstatus,pending_statusandcountry_type. When the deletion collector loads grants with.only(), each read reloads the row and starts the same thing again. Reproduced withGrant.objects.only("id").first()on both 5.2.18 and 6.1.3.GrantResource.export_field(self, field, obj)does not accept the**kwargsthat django-import-export 4.x passes (export_fields).validate_deadlines_formreadscleaned_data["start"], which raisesKeyErrorwhen that field failed validation.files_upload.FileandVideosImportRequest. Theirsearch_fieldslist plain foreign keys (uploaded_by,conference), and Django can't do anicontainslookup on those.create_grant_vouchers. They call Pretix row by row without handling the error, so a conference without a Pretix event breaks them.resonate-sdkis not changed by this PR.Known issue, not caused by this PR: on the voting changelist, the DAL "By Submission" filter renders as a plain
<select>and Select2 never starts.select2.full.jsloads afteradmin/js/jquery.init.jshas removed the globaljQuery. The script order, Django's vendored Select2, and DAL's JS are the same on Django 5.2 / DAL 3.9.4, so the same thing happens onmain.