def wrap_participant_creation()

in api/choice_algorithm.py [0:0]


def wrap_participant_creation(wheel, participant):
    participant['weight'] = get_sub_wheel_size(participant['name'])
    yield
    count = 0
    with WheelParticipant.batch_writer() as batch:
        for p in WheelParticipant.iter_query(KeyConditionExpression=Key('wheel_id').eq(wheel['id'])):
            count += 1
    Wheel.update_item(
        Key={'id': wheel['id']},
        **to_update_kwargs({'participant_count': count})
    )