Conversation
blog_index() built its `last_page` context flag from `page.has_previous()`, which is the inverse of what the name promises: False on the first page and True on every other one. The flag is not read by any template today, so nothing is visibly broken — this is a latent bug that would mislead the first consumer of the variable. Adds two regression tests covering the multi-page case (first, middle and final page) and the single-page case, where the only page is also the last. Closes #857 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HXUw7kyELDu8ycGQxtaFbb
Per @pablodiegoss on #857: the flag is read by nothing — no template, no view, no test — so fixing its value was the wrong call. It set page.has_previous(), the inverse of what the name promises, and the "pagination breaks" symptom in the issue never existed. Removes it and replaces the earlier regression tests with one that keeps a readerless flag from coming back. Closes #857 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HXUw7kyELDu8ycGQxtaFbb
This branch has not been deployed
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.
Description
Reworked after reading @pablodiegoss's comment on the issue (#857), which I had not seen when I first opened this. He is right, and the first version of this PR was wrong: it fixed
last_page's value when the correct fix is to delete it.blog_index()set"last_page": page.has_previous()— the inverse of what the name promises — and nothing reads it.grep -rn last_page src/finds only the assignment itself: no template, no other view, no test. So the "incorrect pagination" symptom described in the issue never existed, which is exactly what he could not reproduce.This removes the flag.
Resolves (Issues)
Closes #857
General tasks performed
"last_page"from theblog_index()context.Net diff against
develop: one deleted line insrc/blog/views.pyplus one test.Verification:
pytest src/blogpasses, 7 tests.ruff format --diff src/clean;ruff check --extend-select Ireports the same count asdevelop.Have you confirmed the application builds locally without error? See here.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HXUw7kyELDu8ycGQxtaFbb
Generated by Claude Code