Skip to content

Fixes #2159 -- Do not HTML-escape traces in the cache and profiling panel #2164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2025

Conversation

matthiask
Copy link
Member

@matthiask matthiask commented Jul 22, 2025

Description

The panel data has to be explicitly reloaded from the store to hit this case. The new reload_stats utility helps with this.

Fixes #2159

Checklist:

  • I have added the relevant tests for this change.
  • I have added an item to the Pending section of docs/changes.rst.

@matthiask
Copy link
Member Author

It's really annoying. The tests pass both with and without the |safe, but the code obviously doesn't do the right thing when removing |safe.

I have traced the code through the data serialization and it seems to me that the traces are properly serialized. So, I don't understand why the test doesn't show the problem...

…nd profiling panel

The panel data has to be explicitly reloaded from the store to hit this
case. The new ``reload_stats`` utility helps with this.
@matthiask matthiask changed the title Refs #2159 -- Do not HTML-escape traces in the cache panel Fixes #2159 -- Do not HTML-escape traces in the cache and profiling panel Jul 22, 2025
@matthiask
Copy link
Member Author

I have found the problem. The panel data has to be forcibly reloaded from the store before rendering, otherwise the SafeString objects are still around.

@matthiask matthiask requested a review from tim-schilling July 22, 2025 19:01
Copy link
Member

@tim-schilling tim-schilling left a comment

Choose a reason for hiding this comment

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

Thank you for tracking this one down!

@tim-schilling tim-schilling merged commit 08a110e into django-commons:main Jul 22, 2025
25 checks passed
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.

Profiling panel is rendering the html as text
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy