Skip to content

Fix inverted last_page logic in blog_index (#857)#923

Closed
vjpixel wants to merge 1 commit intodevelopfrom
claude/fix-857-blog-last-page
Closed

Fix inverted last_page logic in blog_index (#857)#923
vjpixel wants to merge 1 commit intodevelopfrom
claude/fix-857-blog-last-page

Conversation

@vjpixel
Copy link
Copy Markdown
Member

@vjpixel vjpixel commented Apr 25, 2026

page.has_previous() returns True for every page except the first, so using it as a 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 (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

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
Copy link
Copy Markdown
Member Author

vjpixel commented Apr 25, 2026

Self-review

Verdict: ✅

One-line fix: page.has_previous()not page.has_next(). Matches the variable name's intent.

Note: the last_page context key isn't actually consumed by any current template — post_preview.jinja2 drives the "see more" button via next_page_number <= total_pages. So no visible behavior change today, just removes the misleading code.

Duplicate: #909 has the same fix.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

vjpixel commented Apr 25, 2026

Closing in favor of @SAY-5's #909 (same fix, opened first). See review there.


Generated by Claude Code

@vjpixel vjpixel closed this Apr 25, 2026
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.

blog_index view has inverted last_page logic using has_previous() instead of not has_next()

2 participants