From ab2e94b3df9ff42cf8dfe2a9700f977fe0565056 Mon Sep 17 00:00:00 2001 From: Mawoka Date: Wed, 12 Jul 2023 11:28:06 +0200 Subject: [PATCH] :ambulance: Fixed broken like button --- classquiz/routers/community.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classquiz/routers/community.py b/classquiz/routers/community.py index a7d95e3..fcc080a 100644 --- a/classquiz/routers/community.py +++ b/classquiz/routers/community.py @@ -62,7 +62,7 @@ async def rate_quiz(data: RateQuizInput, quiz_id: uuid.UUID, user: User = Depend positive = False if rating is not None and rating.positive == positive: raise HTTPException(status_code=409, detail="Rating already submitted") - elif rating.positive != positive: + elif rating is not None and rating.positive != positive: await rating.delete() if rating.positive: quiz.likes -= 1