From 3001b789212c61c7c8651a15ccc1450953d2d83a Mon Sep 17 00:00:00 2001 From: rrr-marble Date: Fri, 2 Jul 2021 15:35:47 +0300 Subject: [PATCH] fix: cookies are str now --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 42a8d8c..699546f 100644 --- a/main.py +++ b/main.py @@ -42,7 +42,7 @@ async def new_session(): @app.get("/next_picture/{cookie}") -async def next_picture(cookie: int): +async def next_picture(cookie: str): """Request new picture to rate.""" # check if the cookie is valid cur.execute( @@ -90,8 +90,8 @@ async def next_picture(cookie: int): } # Q: do we return something specific, or just use a convention here? -@app.get("/rate_picture/{session_id}/{picture_id}/{mark}") -async def rate_picture(session_id: int, picture_id: int, mark: int): +@app.get("/rate_picture/{cookie}/{picture_id}/{mark}") +async def rate_picture(cookie: str, picture_id: int, mark: int): """Submit a rating for the picture""" # check if the cookie is valid cur.execute(