We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 158349c commit 2869082Copy full SHA for 2869082
1 file changed
utils/htmx.py
@@ -47,7 +47,7 @@ def _render_toast_html(
47
"base/partials/toast.html",
48
{"message": message, "level": level},
49
)
50
- return resp.body.decode()
+ return bytes(resp.body).decode()
51
52
53
def append_toast(
@@ -59,7 +59,7 @@ def append_toast(
59
) -> TemplateResponse:
60
"""Append an OOB toast partial to an existing TemplateResponse body."""
61
toast_html = _render_toast_html(request, templates, message, level)
62
- original_body = response.body.decode()
+ original_body = bytes(response.body).decode()
63
response.body = (original_body + toast_html).encode()
64
# Update content-length header
65
response.headers["content-length"] = str(len(response.body))
0 commit comments