Correction des présences et correction de plusieurs erreurs mineur de déplacement/parcours de l'utilisateur, harmonisation des processus
This commit is contained in:
+6
-4
@@ -19,7 +19,7 @@ def can_schedule_match():
|
||||
Returns:
|
||||
bool: True if user is president, manager, coach, or scout.
|
||||
"""
|
||||
return current_user.role in ['president', 'manager', 'coach', 'scout']
|
||||
return current_user.role in ['admin', 'manager', 'coach', 'scout']
|
||||
|
||||
|
||||
@matches_bp.route('/calendar')
|
||||
@@ -248,7 +248,7 @@ def get_visible_tryouts_for_user():
|
||||
Returns:
|
||||
list: Query result of Tryout objects.
|
||||
"""
|
||||
if current_user.role == 'president':
|
||||
if current_user.role == 'admin':
|
||||
return Tryout.query.order_by(Tryout.date).all()
|
||||
elif current_user.role == 'manager':
|
||||
return Tryout.query.filter_by(created_by=current_user.id).order_by(Tryout.date).all()
|
||||
@@ -558,8 +558,10 @@ def edit_match(match_id):
|
||||
# Handle player vs player matches - update participants
|
||||
elif match.match_type == 'player_vs_player':
|
||||
MatchParticipant.query.filter_by(match_id=match.id).delete()
|
||||
team1_player_ids = request.form.getlist('team1_player_ids')
|
||||
team2_player_ids = request.form.getlist('team2_player_ids')
|
||||
team1_str = request.form.get('team1_player_ids', '')
|
||||
team2_str = request.form.get('team2_player_ids', '')
|
||||
team1_player_ids = [p for p in team1_str.split(',') if p.strip()] if team1_str else []
|
||||
team2_player_ids = [p for p in team2_str.split(',') if p.strip()] if team2_str else []
|
||||
notified_participant_ids = []
|
||||
for pid in team1_player_ids:
|
||||
participant = MatchParticipant(match_id=match.id, player_id=int(pid), team_side=1)
|
||||
|
||||
Reference in New Issue
Block a user