retrait de page html redondantes, ajout de la modification des username et affichage des userrname au lieu des noms complets
This commit is contained in:
+6
-6
@@ -82,7 +82,7 @@ def api_events():
|
||||
# Player scrim - show all participants
|
||||
player_names = []
|
||||
for p in match.participants.all():
|
||||
player_name = p.player.full_name if p.player else 'Unknown Player'
|
||||
player_name = p.player.username if p.player else 'Unknown Player'
|
||||
player_names.append(player_name)
|
||||
participants_str = ', '.join(player_names) if player_names else 'No players'
|
||||
match_desc = participants_str + (f"<br>{match.description}" if match.description else '')
|
||||
@@ -186,11 +186,11 @@ def api_events_for_tryout(tryout_id):
|
||||
team1_players = []
|
||||
for p in match.participants.filter_by(team_side=1).all():
|
||||
if p.player:
|
||||
team1_players.append(p.player.full_name)
|
||||
team1_players.append(p.player.username)
|
||||
team2_players = []
|
||||
for p in match.participants.filter_by(team_side=2).all():
|
||||
if p.player:
|
||||
team2_players.append(p.player.full_name)
|
||||
team2_players.append(p.player.username)
|
||||
if team1_players and team2_players:
|
||||
participants_str = f"{', '.join(team1_players)} vs {', '.join(team2_players)}"
|
||||
else:
|
||||
@@ -198,7 +198,7 @@ def api_events_for_tryout(tryout_id):
|
||||
else:
|
||||
player_names = []
|
||||
for p in match.participants.all():
|
||||
player_name = p.player.full_name if p.player else 'Unknown Player'
|
||||
player_name = p.player.username if p.player else 'Unknown Player'
|
||||
player_names.append(player_name)
|
||||
participants_str = ', '.join(player_names) if player_names else 'No players'
|
||||
|
||||
@@ -295,7 +295,7 @@ def create_match(tryout_id):
|
||||
teams = Team.query.filter_by(tryout_id=tryout_id).all()
|
||||
registrations = TryoutRegistration.query.filter_by(tryout_id=tryout_id).all()
|
||||
all_players = [User.query.get(r.player_id) for r in registrations if User.query.get(r.player_id)]
|
||||
all_players = sorted([p for p in all_players if p], key=lambda x: x.full_name)
|
||||
all_players = sorted([p for p in all_players if p], key=lambda x: x.username)
|
||||
|
||||
if request.method == 'POST':
|
||||
title = request.form.get('title')
|
||||
@@ -453,7 +453,7 @@ def edit_match(match_id):
|
||||
# Only show players registered for this tryout
|
||||
registrations = TryoutRegistration.query.filter_by(tryout_id=tryout.id).all()
|
||||
all_players = [User.query.get(r.player_id) for r in registrations if r.player_id]
|
||||
all_players = sorted([p for p in all_players if p], key=lambda x: x.full_name)
|
||||
all_players = sorted([p for p in all_players if p], key=lambda x: x.username)
|
||||
current_player_ids = [p.player_id for p in match.participants.all()]
|
||||
# Get players grouped by team side for player_vs_player matches
|
||||
team1_player_ids = [p.player_id for p in match.participants.filter_by(team_side=1).all()]
|
||||
|
||||
Reference in New Issue
Block a user