From 05230388d87588039f38d99d8a9c7464be96c71c Mon Sep 17 00:00:00 2001 From: Sage Abdullah Date: Tue, 27 Aug 2024 16:56:46 +0100 Subject: [PATCH] Fix GenericPageBreadcrumbsMixin to correctly take the specified number of items The old code was taking the N-th item from the view's generic breadcrumbs instead of taking the last N items as the comment suggests --- wagtail/admin/views/pages/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wagtail/admin/views/pages/utils.py b/wagtail/admin/views/pages/utils.py index b0aed10fc3..df8cd15ed0 100644 --- a/wagtail/admin/views/pages/utils.py +++ b/wagtail/admin/views/pages/utils.py @@ -66,6 +66,7 @@ class GenericPageBreadcrumbsMixin: # which in most cases is the final item that links to the current view. # However, this can be customised in the case of generic views that are # nested inside another generic view. - return self.breadcrumbs_items + [ - super().get_breadcrumbs_items()[-self.breadcrumbs_items_to_take] - ] + return ( + self.breadcrumbs_items + + super().get_breadcrumbs_items()[-self.breadcrumbs_items_to_take :] + )