Skip to content

Commit 2869082

Browse files
Type checks and lints
1 parent 158349c commit 2869082

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

utils/htmx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def _render_toast_html(
4747
"base/partials/toast.html",
4848
{"message": message, "level": level},
4949
)
50-
return resp.body.decode()
50+
return bytes(resp.body).decode()
5151

5252

5353
def append_toast(
@@ -59,7 +59,7 @@ def append_toast(
5959
) -> TemplateResponse:
6060
"""Append an OOB toast partial to an existing TemplateResponse body."""
6161
toast_html = _render_toast_html(request, templates, message, level)
62-
original_body = response.body.decode()
62+
original_body = bytes(response.body).decode()
6363
response.body = (original_body + toast_html).encode()
6464
# Update content-length header
6565
response.headers["content-length"] = str(len(response.body))

0 commit comments

Comments
 (0)