Исправлена ошибка MissingGreenlet в use_skip_exile
Убрана проверка assignment.challenge, которая вызывала lazy loading в асинхронном контексте. Теперь всегда выполняется явный запрос для получения game_id из Challenge. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -138,16 +138,12 @@ class ConsumablesService:
|
||||
if assignment.is_playthrough:
|
||||
game_id = assignment.game_id
|
||||
else:
|
||||
# Need to load challenge to get game_id
|
||||
if assignment.challenge:
|
||||
game_id = assignment.challenge.game_id
|
||||
else:
|
||||
# Load challenge if not already loaded
|
||||
result = await db.execute(
|
||||
select(Challenge).where(Challenge.id == assignment.challenge_id)
|
||||
)
|
||||
challenge = result.scalar_one()
|
||||
game_id = challenge.game_id
|
||||
# Load challenge to get game_id
|
||||
result = await db.execute(
|
||||
select(Challenge).where(Challenge.id == assignment.challenge_id)
|
||||
)
|
||||
challenge = result.scalar_one()
|
||||
game_id = challenge.game_id
|
||||
|
||||
# Check if game is already exiled
|
||||
existing = await db.execute(
|
||||
|
||||
Reference in New Issue
Block a user