summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-04-26 08:36:56 +0200
committerGitHub <noreply@github.com>2023-04-26 08:36:56 +0200
commit9440f6ba41e5e96458cd7949fc6d605ef5bd09e9 (patch)
tree6804598db9f0002c1a1dcd7437f0f5f954991a85
parent453cfa28156f2c00cc45645421af4182aa863ff4 (diff)
downloaddjango-9440f6ba41e5e96458cd7949fc6d605ef5bd09e9.tar.gz
Fixed #34512 -- Restored breadcrumbs on admin app index view.
Thanks Adam (ataylor32) for the report. Regression in 872b61193b013a700ff88cf50f0eb2cf2c266ff7.
-rw-r--r--django/contrib/admin/templates/admin/app_index.html18
-rw-r--r--docs/releases/4.2.1.txt3
-rw-r--r--tests/admin_views/test_breadcrumbs.py4
3 files changed, 17 insertions, 8 deletions
diff --git a/django/contrib/admin/templates/admin/app_index.html b/django/contrib/admin/templates/admin/app_index.html
index 886bf6ca00..727f72b190 100644
--- a/django/contrib/admin/templates/admin/app_index.html
+++ b/django/contrib/admin/templates/admin/app_index.html
@@ -4,14 +4,16 @@
{% block bodyclass %}{{ block.super }} app-{{ app_label }}{% endblock %}
{% if not is_popup %}
-{% block breadcrumbs %}
-<div class="breadcrumbs">
-<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
-&rsaquo;
-{% for app in app_list %}
-{{ app.name }}
-{% endfor %}
-</div>
+{% block nav-breadcrumbs %}
+ <nav aria-label="{% translate 'Breadcrumbs' %}">
+ <div class="breadcrumbs">
+ <a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
+ &rsaquo;
+ {% for app in app_list %}
+ {{ app.name }}
+ {% endfor %}
+ </div>
+ </nav>
{% endblock %}
{% endif %}
diff --git a/docs/releases/4.2.1.txt b/docs/releases/4.2.1.txt
index ffc9394dae..31747c1a23 100644
--- a/docs/releases/4.2.1.txt
+++ b/docs/releases/4.2.1.txt
@@ -44,3 +44,6 @@ Bugfixes
* Fixed a regression in Django 4.2 that caused incorrect ``ClearableFileInput``
margins in the admin (:ticket:`34506`).
+
+* Fixed a regression in Django 4.2 where breadcrumbs didn't appear on admin
+ site app index views (:ticket:`34512`).
diff --git a/tests/admin_views/test_breadcrumbs.py b/tests/admin_views/test_breadcrumbs.py
index ee4285f9a9..87186e251c 100644
--- a/tests/admin_views/test_breadcrumbs.py
+++ b/tests/admin_views/test_breadcrumbs.py
@@ -23,3 +23,7 @@ class AdminBreadcrumbsTests(TestCase):
def test_breadcrumbs_present(self):
response = self.client.get(reverse("admin:auth_user_add"))
self.assertContains(response, '<nav aria-label="Breadcrumbs">')
+ response = self.client.get(
+ reverse("admin:app_list", kwargs={"app_label": "auth"})
+ )
+ self.assertContains(response, '<nav aria-label="Breadcrumbs">')