Skip to content

Commit

Permalink
Fix paginating to second page without breadcrumbs. Fantomas42#551
Browse files Browse the repository at this point in the history
  • Loading branch information
dismine committed Dec 15, 2022
1 parent 176ac6a commit b829e38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-------------------

* Drop support for Django<3.1.
* Fix paginating to second page without breadcrumbs.

0.22.0-hk - 2022/12/02
-------------------
Expand Down
2 changes: 1 addition & 1 deletion zinnia/breadcrumbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def wrapper(path, model, page, root_name):
path = PAGE_REGEXP.sub('', path)
breadcrumbs = func(path, model, root_name)
if page:
if page.number > 1:
if page.number > 1 and breadcrumbs:
breadcrumbs[-1].url = path
page_crumb = Crumb(_('Page %s') % page.number)
breadcrumbs.append(page_crumb)
Expand Down

0 comments on commit b829e38

Please sign in to comment.