Skip to content

Commit

Permalink
transactions: Check if player reg already exists for event
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe2k committed Sep 13, 2024
1 parent f135ce2 commit 1928ea7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/transaction/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ def create_transaction(
if not can_register and error:
return 400, error

if Registration.objects.filter(event=event, player=player).exists():
return 400, {
"message": f"Player - {player.user.get_full_name()} already registered for this event in another team !"
}

start_date = event.start_date
end_date = event.end_date
amount = event.player_fee * len(players)
Expand Down

0 comments on commit 1928ea7

Please sign in to comment.