fix registration issues

online_registration
Raz 11 months ago
parent b8609f8c94
commit a863748f52
  1. 36
      tournaments/utils/player_search.py

@ -64,23 +64,25 @@ def get_player_name_from_csv(category, licence_id, base_folder=None):
reader = csv.reader(file, delimiter=';')
rows = list(reader) # Read all rows at once to process later
for row in rows:
if len(row) >= 15: # Ensure row has enough columns
current_licence_id = row[5]
if current_licence_id == str(cleaned_licence_id):
data = {
"first_name": row[3], # 4th column: first name
"last_name": row[2], # 3rd column: last name
"rank": row[1],
"points": row[6],
"assimilation": row[7],
"tournament_count": row[8],
"ligue_name": row[9],
"club_name": row[11],
"birth_year": row[14],
"is_woman": is_woman,
}
return data, True
if cleaned_licence_id:
for row in rows:
if len(row) >= 15: # Ensure row has enough columns
current_licence_id = row[5]
if current_licence_id == str(cleaned_licence_id):
data = {
"first_name": row[3], # 4th column: first name
"last_name": row[2], # 3rd column: last name
"rank": row[1],
"points": row[6],
"assimilation": row[7],
"tournament_count": row[8],
"ligue_name": row[9],
"club_name": row[11],
"birth_year": row[14],
"is_woman": is_woman,
}
return data, True
# Determine the rank for an unranked player
if rows:

Loading…
Cancel
Save