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) )