🚑 Fixed broken like button

This commit is contained in:
Mawoka
2023-07-12 11:28:06 +02:00
parent 0177f5371d
commit ab2e94b3df
+1 -1
View File
@@ -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