Skip to content

Commit

Permalink
Fix a bug in singleplayer tournament signup
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian-Hirt authored Dec 7, 2023
1 parent 9fea39d commit 82f1aef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/operations/tournament/team/create_for_tournament.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class CreateForTournament < RailsOps::Operation::Model::Create

fail Operations::Exceptions::OpFailed, _('Tournament|You are already in the tournament') if context.user.teams.where(tournament: tournament).any?

# If the tournament is already full and a singleplayer tournament,
# throw an error
fail Operations::Exceptions::OpFailed, _('Tournament|The tournament is full') if tournament.singleplayer? && model.tournament.teams_full?

# If the tournament is linked to a lan_party, the current_user needs to have a ticket
# in "checked_in" status to create a team.
# rubocop:disable Style/SoleNestedConditional
Expand Down

0 comments on commit 82f1aef

Please sign in to comment.