Hotfix: award snippet leaked a multi-line {# #} comment onto every card (2.14.2)#1357
Merged
Conversation
A 3-line {# #} comment added in 2.14.1 leaked as literal text onto every award
card on prod — Django's {# #} only supports single-line comments. Replaced with a
{% comment %} block. Added regression guards (no '{#' / explanatory text in the
rendered page). Bumps to 2.14.2.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a coding-convention note so this recurring footgun (multi-line {# #}
rendering as visible text) gets caught — same bug this PR fixes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem (live on prod)
The explanatory comment I added to
display_award_snippet.htmlin 2.14.1 (#1356) was a multi-line{# #}comment. Django's{# #}only supports single-line comments, so the whole thing — including the literal text '…output reads "Name, Project" and never "Name , Project". #}' — rendered as visible text on every award card on production.(The actual recipient/project spacing fix from 2.14.1 is fine; this was a separate, self-inflicted regression in the comment.)
Fix
Replace the multi-line
{# #}with a{% comment %}…{% endcomment %}block (multi-line safe, renders nothing).Test
Added guards to the award render test: the page must not contain
{#or the explanatory text. The existing spacing test missed this because the leaked comment used placeholder names ("Name") rather than the test's data. All 12 award tests pass.Version
2.14.2 (hotfix).
🤖 Generated with Claude Code