Untested Ormar and FastAPI update

This commit is contained in:
Mawoka
2025-05-20 12:12:06 +02:00
parent 2bfd73412d
commit 03e85f8586
31 changed files with 719 additions and 694 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ from classquiz.db.models import PlayGame, GameResults
async def save_quiz_to_storage(game_pin: str):
game = PlayGame.parse_raw(await redis.get(f"game:{game_pin}"))
game = PlayGame.model_validate_json(await redis.get(f"game:{game_pin}"))
player_count = await redis.scard(f"game_session:{game_pin}:players")
answers = []
for i in range(len(game.questions)):
@@ -26,7 +26,7 @@ async def save_quiz_to_storage(game_pin: str):
custom_field_data = await redis.hgetall(f"game:{game_pin}:players:custom_fields")
q_return = []
for q in game.questions:
q_return.append(q.dict())
q_return.append(q.model_dump())
data = GameResults(
id=game.game_id,
quiz=game.quiz_id,