Fix inverted last_page logic in blog_index (#857)#923
Closed
Fix inverted last_page logic in blog_index (#857)#923
Conversation
page.has_previous() returns True for every page except the first, so using it as last_page indicator was exactly backwards. Switch to not page.has_next() to match the intended semantics. The context key is currently not consumed by any template, so this has no visible effect — but fixes the misleading code. Closes #857 https://claude.ai/code/session_01XC1THLWgnGXGf5wgRhdyvB
This was referenced Apr 25, 2026
Member
Author
Self-reviewVerdict: ✅ One-line fix: Note: the Duplicate: #909 has the same fix. Generated by Claude Code |
Member
Author
|
Closing in favor of @SAY-5's #909 (same fix, opened first). See review there. Generated by Claude Code |
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.
page.has_previous()returnsTruefor every page except the first, so using it as alast_pageindicator was exactly backwards. Switch tonot page.has_next()to match the intended semantics.The context key is currently not consumed by any template (the pagination button uses
next_page_number <= total_pages), so this has no visible effect — but the original code was misleading. Per @pablodiegoss: "Looks legitimate ... should make the current code cleaner and easier to read."Closes #857
https://claude.ai/code/session_01XC1THLWgnGXGf5wgRhdyvB
Generated by Claude Code