Update tournament_registration.py

sync_v2
Razmig Sarkissian 5 months ago
parent af83311c9d
commit aa73c904a4
  1. 10
      tournaments/services/tournament_registration.py

@ -412,17 +412,23 @@ class RegistrationCartManager:
else: else:
sex = None sex = None
tournament_count = player_data.get('tournament_count') tournament_count = player_data.get('tournament_count', None)
if tournament_count is not None:
try: try:
tournament_played = int(tournament_count) tournament_played = int(tournament_count)
except ValueError: except ValueError:
tournament_played = None tournament_played = None
else:
tournament_played = None
points = player_data.get('points') points = player_data.get('points', None)
if points is not None:
try: try:
points = float(points) points = float(points)
except ValueError: except ValueError:
points = None points = None
else:
points = None
# Create player registration with all the original fields # Create player registration with all the original fields
PlayerRegistration.objects.create( PlayerRegistration.objects.create(

Loading…
Cancel
Save