Change rematch event to change game
This commit is contained in:
@@ -307,12 +307,12 @@ async def complete_assignment(
|
||||
# Check active event for point multipliers
|
||||
active_event = await event_service.get_active_event(db, marathon_id)
|
||||
|
||||
# For jackpot/rematch: use the event_type stored in assignment (since event may be over)
|
||||
# For jackpot: use the event_type stored in assignment (since event may be over)
|
||||
# For other events: use the currently active event
|
||||
effective_event = active_event
|
||||
|
||||
# Handle assignment-level event types (jackpot, rematch)
|
||||
if assignment.event_type in [EventType.JACKPOT.value, EventType.REMATCH.value]:
|
||||
# Handle assignment-level event types (jackpot)
|
||||
if assignment.event_type == EventType.JACKPOT.value:
|
||||
# Create a mock event object for point calculation
|
||||
class MockEvent:
|
||||
def __init__(self, event_type):
|
||||
@@ -353,8 +353,8 @@ async def complete_assignment(
|
||||
"points": total_points,
|
||||
"streak": participant.current_streak,
|
||||
}
|
||||
# Log event info (use assignment's event_type for jackpot/rematch, active_event for others)
|
||||
if assignment.event_type in [EventType.JACKPOT.value, EventType.REMATCH.value]:
|
||||
# Log event info (use assignment's event_type for jackpot, active_event for others)
|
||||
if assignment.event_type == EventType.JACKPOT.value:
|
||||
activity_data["event_type"] = assignment.event_type
|
||||
activity_data["event_bonus"] = event_bonus
|
||||
elif active_event:
|
||||
|
||||
Reference in New Issue
Block a user