From d295ff2aff7eaa7a4bcccff01cc0a4eebf621328 Mon Sep 17 00:00:00 2001 From: "mamonov.ep" Date: Tue, 30 Dec 2025 23:02:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BA=D0=BB=D1=8E=D1=87=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B8=D0=B3=D1=80=D1=8B=20=D1=82=D0=B8=D0=BF?= =?UTF-8?q?=D0=B0=20=D0=9F=D1=80=D0=BE=D1=85=D0=BE=D0=B6=D0=B4=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B8=D0=B7=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D0=BA=D0=B8=20=D1=87=D0=B5=D0=BB=D0=BB=D0=B5=D0=BD=D0=B4?= =?UTF-8?q?=D0=B6=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit При старте марафона теперь проверяются только игры с типом challenges. Игры с типом playthrough не требуют наличия челленджей. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- backend/app/api/v1/marathons.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/app/api/v1/marathons.py b/backend/app/api/v1/marathons.py index b82c1d6..c13b5ec 100644 --- a/backend/app/api/v1/marathons.py +++ b/backend/app/api/v1/marathons.py @@ -308,9 +308,12 @@ async def start_marathon(marathon_id: int, current_user: CurrentUser, db: DbSess if len(approved_games) == 0: raise HTTPException(status_code=400, detail="Добавьте и одобрите хотя бы одну игру") - # Check that all approved games have at least one challenge + # Check that all approved challenge-based games have at least one challenge + # Playthrough games don't need challenges games_without_challenges = [] for game in approved_games: + if game.is_playthrough: + continue # Игры типа "Прохождение" не требуют челленджей challenge_count = await db.scalar( select(func.count()).select_from(Challenge).where(Challenge.game_id == game.id) )