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

Loading…
Cancel
Save