Skip to content

Render richtext help text on login pages.#4533

Merged
frjo merged 2 commits into
mainfrom
fix/login_concent_help_text_render
May 8, 2025
Merged

Render richtext help text on login pages.#4533
frjo merged 2 commits into
mainfrom
fix/login_concent_help_text_render

Conversation

@frjo

@frjo frjo commented May 6, 2025

Copy link
Copy Markdown
Member

No description provided.

@frjo frjo added Type: Bug Bugs! Things that are broken :-/ Type: Patch Mini change, used in release drafter labels May 6, 2025

{% if field.help_text %}
<div class="form__help prose prose-sm">{{ field.help_text }}</div>
<div class="form__help prose prose-sm">{{ field.help_text|safe }}</div>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an ok way to solve this? Help text should only come from trusted sources from what I can see.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use nh3 to be on safer side?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a "TypeError: argument 'html': 'lazy..proxy' object cannot be converted to 'PyString'" and realised I'm doing it wrong.

Shifted to using "mark_safe()" for this specific help_text instead of messing with rendering of all help_text.

I think this is a more correct approach.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

@frjo frjo requested a review from theskumar May 6, 2025 08:24
@frjo frjo added Status: Needs testing Tickets that need testing/qa Status: Needs dev testing 🧑‍💻 Tasks that should be tested by the dev team labels May 7, 2025
@frjo frjo removed Status: Needs testing Tickets that need testing/qa Status: Needs dev testing 🧑‍💻 Tasks that should be tested by the dev team labels May 8, 2025
@frjo frjo merged commit 7f23145 into main May 8, 2025
7 checks passed
@theskumar theskumar deleted the fix/login_concent_help_text_render branch July 20, 2025 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Bugs! Things that are broken :-/ Type: Patch Mini change, used in release drafter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants