Skip to content

Commit 76116dd

Browse files
committed
fix bad encoding on response
1 parent ea8b175 commit 76116dd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mystbin/backend/routers/pastes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from asyncpg import Record
2929
from fastapi import APIRouter, File, Response, UploadFile
3030
from fastapi.responses import UJSONResponse
31+
from fastapi.encoders import jsonable_encoder
3132
from models import errors, payloads, responses
3233

3334
from mystbin_models import MystbinRequest
@@ -278,7 +279,7 @@ async def get_all_pastes(
278279
pastes = await request.app.state.db.get_all_user_pastes(user["id"], limit)
279280
pastes = [dict(entry) for entry in pastes]
280281

281-
return UJSONResponse({"pastes": pastes})
282+
return UJSONResponse({"pastes": jsonable_encoder(pastes)})
282283

283284

284285
desc = f"""Edit a paste.

0 commit comments

Comments
 (0)