Исключить игры типа Прохождение из проверки челленджей
При старте марафона теперь проверяются только игры с типом challenges. Игры с типом playthrough не требуют наличия челленджей. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user