style: formater le depot avec ruff format
QUA-002, premiere moitie. **Ce commit ne fait que reformater** : aucun changement de comportement, aucune ligne de logique touchee. 72 fichiers, 4 restaient deja conformes. Il est isole exprès, pour que `git log -p` sur les commits voisins reste lisible. `quote-style = "preserve"` etait deja pose dans pyproject.toml, ce qui evite le brassage guillemets simples / doubles : le diff porte sur les retours a la ligne, l indentation des appels longs et les virgules finales, pas sur le style de chaine. Verification : 263 tests passent avant et apres, ruff check propre. L activation en CI arrive dans le commit suivant, separement, pour que ce diff-ci ne contienne rien d autre. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
+29
-14
@@ -33,6 +33,7 @@ from app.extensions import db
|
||||
# Team attachment
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def coach_org_teams(coach):
|
||||
"""Organisation teams a coach is attached to, ordered by name.
|
||||
|
||||
@@ -47,12 +48,16 @@ def coach_org_teams(coach):
|
||||
"""
|
||||
from app.models import OrgTeam
|
||||
|
||||
return OrgTeam.query.filter(
|
||||
db.or_(
|
||||
OrgTeam.coaches.any(id=coach.id),
|
||||
OrgTeam.coach_id == coach.id,
|
||||
return (
|
||||
OrgTeam.query.filter(
|
||||
db.or_(
|
||||
OrgTeam.coaches.any(id=coach.id),
|
||||
OrgTeam.coach_id == coach.id,
|
||||
)
|
||||
)
|
||||
).order_by(OrgTeam.name).all()
|
||||
.order_by(OrgTeam.name)
|
||||
.all()
|
||||
)
|
||||
|
||||
|
||||
def coach_org_team_ids(coach):
|
||||
@@ -81,12 +86,16 @@ def manager_org_teams(manager):
|
||||
"""
|
||||
from app.models import OrgTeam
|
||||
|
||||
return OrgTeam.query.filter(
|
||||
db.or_(
|
||||
OrgTeam.managers.any(id=manager.id),
|
||||
OrgTeam.manager_id == manager.id,
|
||||
return (
|
||||
OrgTeam.query.filter(
|
||||
db.or_(
|
||||
OrgTeam.managers.any(id=manager.id),
|
||||
OrgTeam.manager_id == manager.id,
|
||||
)
|
||||
)
|
||||
).order_by(OrgTeam.name).all()
|
||||
.order_by(OrgTeam.name)
|
||||
.all()
|
||||
)
|
||||
|
||||
|
||||
def attached_org_teams(user):
|
||||
@@ -154,6 +163,7 @@ def can_manage_org_team(user, org_team):
|
||||
# Reach over players
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def org_team_player_ids(team_ids):
|
||||
"""IDs of the players placed on any of these teams.
|
||||
|
||||
@@ -227,10 +237,14 @@ def coach_can_access_player(coach, player_id):
|
||||
if registered:
|
||||
return True
|
||||
|
||||
plays_a_match = MatchParticipant.query.join(Match).filter(
|
||||
MatchParticipant.player_id == player_id,
|
||||
Match.tryout_id.in_(tryout_ids),
|
||||
).first()
|
||||
plays_a_match = (
|
||||
MatchParticipant.query.join(Match)
|
||||
.filter(
|
||||
MatchParticipant.player_id == player_id,
|
||||
Match.tryout_id.in_(tryout_ids),
|
||||
)
|
||||
.first()
|
||||
)
|
||||
return plays_a_match is not None
|
||||
|
||||
|
||||
@@ -262,6 +276,7 @@ def can_manage_player_contract(user, player_id):
|
||||
# Tryouts
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def coach_tryouts(coach, team_ids=None):
|
||||
"""Tryouts a coach manages, ordered by date.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user