Skip to content

[18.0][FIX] auto_backup: use Markup for HTML message bodies#3655

Open
rrebollo wants to merge 1 commit into
OCA:18.0from
BinhexTeam:18.0-fix-auto_backup-markup-html
Open

[18.0][FIX] auto_backup: use Markup for HTML message bodies#3655
rrebollo wants to merge 1 commit into
OCA:18.0from
BinhexTeam:18.0-fix-auto_backup-markup-html

Conversation

@rrebollo

@rrebollo rrebollo commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

When a database backup fails (or its cleanup fails), the error message is posted to the chatter via message_post(). The body was constructed as a plain f-string containing HTML tags (<p>, <pre>), but message_post() calls markupsafe.escape() on the body. A plain str gets HTML-escaped, causing the tags to appear as raw literal text in the chatter.

Wrapping the body in Markup signals that the content is already safe HTML and should not be re-escaped, matching the approach used throughout Odoo 18 core and OCA modules.

@BinhexTeam T22572

message_post() calls markupsafe.escape() on the body parameter.
Passing a plain str containing HTML tags caused them to be
escaped and rendered as raw text in the chatter. Wrapping the
body in Markup signals that the content is already safe HTML
and should not be re-escaped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants