Skip to content

Restore admin object tools after the Django 6.1 upgrade - #4877

Merged
marcoacierno merged 1 commit into
mainfrom
fix-admin-object-tools
Nov 30, 2026
Merged

marcoacierno merged 1 commit into
mainfrom
fix-admin-object-tools

Conversation

@marcoacierno

Copy link
Copy Markdown
Member

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.html is replaced by the Astro template, which extends admin/pycon_base.html, which extends custom_admin/templates/admin/django_base.html: a vendored copy of Django's admin/base.html taken around Django 5.1.

Django 6.1 moved {% block object-tools %} out of {% block content %} into a new titles-and-tools wrapper. Django's change_list.html and change_form.html override content and define object-tools as a sibling block, so with the stale copy the object tools were never rendered.

Changes

  • Re-sync django_base.html with Django 6.1.3's admin/base.html. The old copy had no local edits, only upstream drift, so this also picks up CSP nonces, the new breadcrumb markup, the extrabody block and the server timezone attribute.
  • Add a test that renders a changelist through the real admin/base.html → pycon_base.html → django_base.html chain and asserts the object tools are present.

Testing

  • New test fails against the old template and passes with the fix.
  • custom_admin test suite: 17 passed.

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.
@vercel

vercel Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pycon Error Error Nov 30, 2026 2:45pm UTC

Request Review

@codecov

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.63%. Comparing base (8c6fd96) to head (e5ac947).

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@marcoacierno
marcoacierno merged commit b8c5fcb into main Nov 30, 2026
7 of 9 checks passed
@marcoacierno
marcoacierno deleted the fix-admin-object-tools branch November 30, 2026 15:15

This branch had an error being deployed

1 failed deployment
Preview — e5ac9471 Deployed Nov 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant