Repository navigation
Restore admin object tools after the Django 6.1 upgrade - #4877
Merged
Merged
Conversation
admin/base.html is replaced by the Astro template, which extends pycon_base.html, which extends django_base.html: a vendored copy of Django's admin base.html taken around Django 5.1. Django 6.1 moved the object-tools block out of the content block into a new titles-and-tools wrapper. change_list.html and change_form.html override content and define object-tools as a sibling, so with the stale copy the block was dropped: the changelist "Add" button, the change form "History" button and our custom object-tools items all disappeared. Re-sync django_base.html with Django 6.1.3's admin/base.html (the old copy had no local edits) and add a test that renders a changelist through the real template chain and checks the object tools are there.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4877 +/- ##
=======================================
Coverage 92.62% 92.63%
=======================================
Files 360 360
Lines 10967 10967
Branches 956 956
=======================================
+ Hits 10158 10159 +1
+ Misses 684 683 -1
Partials 125 125 🚀 New features to boost your workflow:
|
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.
What
The Django admin changelist lost its "Add" button after the Django 6.1.3 upgrade (#4858). The change form "History" button and our custom object-tools buttons (conference change form, schedule item changelist and change form) disappeared too.
Why
admin/base.htmlis replaced by the Astro template, which extendsadmin/pycon_base.html, which extendscustom_admin/templates/admin/django_base.html: a vendored copy of Django'sadmin/base.htmltaken around Django 5.1.Django 6.1 moved
{% block object-tools %}out of{% block content %}into a newtitles-and-toolswrapper. Django'schange_list.htmlandchange_form.htmloverridecontentand defineobject-toolsas a sibling block, so with the stale copy the object tools were never rendered.Changes
django_base.htmlwith Django 6.1.3'sadmin/base.html. The old copy had no local edits, only upstream drift, so this also picks up CSP nonces, the new breadcrumb markup, theextrabodyblock and the server timezone attribute.admin/base.html→pycon_base.html→django_base.htmlchain and asserts the object tools are present.Testing
custom_admintest suite: 17 passed.