diff --git a/lib/safira/roulette/roulette.ex b/lib/safira/roulette/roulette.ex index 92efc570..7b0454ab 100644 --- a/lib/safira/roulette/roulette.ex +++ b/lib/safira/roulette/roulette.ex @@ -295,7 +295,8 @@ defmodule Safira.Roulette do prize = spin_prize() attendee_prize = get_keys_attendee_prize(attendee.id, prize.id) - # Check if the attendee has already received the maximum amount of this prize, and if so, spin again + # Check if the attendee has already received the maximum amount of this prize, + # and if so, count it as a loss and give them nothing case attendee_prize do nil -> prize @@ -304,7 +305,7 @@ defmodule Safira.Roulette do if attendee_prize.quantity + 1 <= prize.max_amount_per_attendee do prize else - find_valid_prize(attendee) + Repo.one(from p in Prize, where: p.name == "Nada") end end end