Skip to content

fix: Add missing expression on if template tag - #99

Merged
timonweb merged 1 commit into
timonweb:masterfrom
ironworld:fix/missing-if-compare-expression
Apr 23, 2026
Merged

timonweb merged 1 commit into
timonweb:masterfrom
ironworld:fix/missing-if-compare-expression

Conversation

@ironworld

Copy link
Copy Markdown
Contributor

While reviewing the pagination template, I noticed I missed adding the == comparison operator in my previous fix. The {% if %} expression was left as:

{% if page page_obj.number %}

instead of:

{% if page == page_obj.number %}

Without the operator, Django raises a TemplateSyntaxError: Unused 'page_obj.number' at end of if expression, which means the pagination template was completely broken.

This PR fixes the expression and adds a test (test_pagination_highlights_only_current_page) that renders the pagination template and asserts only the current page gets the is-current class — so this kind of mistake won't slip through CI again.

@timonweb
timonweb merged commit efff5c0 into timonweb:master Apr 23, 2026
15 checks passed
@timonweb

Copy link
Copy Markdown
Owner

@ironworld thank you!

timonweb added a commit that referenced this pull request Apr 23, 2026
Restore missing comparison expression in pagination.html {% if %} tag (#99).
@ironworld
ironworld deleted the fix/missing-if-compare-expression branch April 23, 2026 11:41
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.

2 participants