chore(lint): trier les imports, sauf la facade des modeles

Active la regle isort (I) de ruff. 45 fichiers reordonnes, aucun
changement de comportement : la suite passe avant comme apres.

app/models/__init__.py en est exclu. Ses imports sont ranges en onze
couches commentees qui decrivent le graphe de dependances ; trier par
ordre alphabetique laisse chaque titre au-dessus d un import qu il ne
decrit pas, et ce fichier n a qu un role, etre lu.

Commit isole, comme le formatage : un diff de brassage ne doit pas
servir de couverture a un changement de comportement.
This commit is contained in:
GGThed
2026-08-11 11:40:41 -04:00
parent ab0b975211
commit 47ff544848
45 changed files with 213 additions and 170 deletions
+9 -8
View File
@@ -9,16 +9,16 @@ keeps its single `from app.routes.users import users_bp`. The blueprint
itself lives in blueprint.py to keep that import one-directional.
"""
from app.routes.users.blueprint import users_bp
# Imported for their side effect: each module attaches its routes to
# users_bp. Order does not matter; none of them import each other.
from app.routes.users import accounts # noqa: F401,E402
from app.routes.users import availability # noqa: F401,E402
from app.routes.users import contracts # noqa: F401,E402
from app.routes.users import notes # noqa: F401,E402
from app.routes.users import one_on_one # noqa: F401,E402
from app.routes.users import profile # noqa: F401,E402
from app.routes.users import (
accounts, # noqa: F401,E402
availability, # noqa: F401,E402
contracts, # noqa: F401,E402
notes, # noqa: F401,E402
one_on_one, # noqa: F401,E402
profile, # noqa: F401,E402
)
# Re-exported because tests and other modules reach for them by name.
from app.routes.users._shared import ( # noqa: F401,E402
@@ -26,6 +26,7 @@ from app.routes.users._shared import ( # noqa: F401,E402
ALLOWED_SIGNED_EXTENSIONS,
pdf_upload_error,
)
from app.routes.users.blueprint import users_bp
__all__ = [
'ALLOWED_CONTRACT_EXTENSIONS',
+1 -1
View File
@@ -8,7 +8,7 @@ from flask import flash, request
from flask_babel import gettext as _
from app.extensions import db
from app.models import Admin, Coach, Manager, Player, Scout, GAME_PLATFORMS, UserGamertag
from app.models import GAME_PLATFORMS, Admin, Coach, Manager, Player, Scout, UserGamertag
ALLOWED_CONTRACT_EXTENSIONS = {'pdf'}
ALLOWED_SIGNED_EXTENSIONS = {'pdf'}
+3 -3
View File
@@ -12,12 +12,13 @@ from marshmallow import ValidationError
from app.extensions import db, hash_password
from app.logging_config import log_auth_event
from app.models import (
ESPORT_GAMES,
GAME_PLATFORMS,
USER_TYPES,
Admin,
CoachAvailability,
Contract,
ESPORT_GAMES,
Evaluation,
GAME_PLATFORMS,
Match,
MatchParticipant,
OneOnOneRequest,
@@ -31,7 +32,6 @@ from app.models import (
TeamPlayer,
Tryout,
TryoutRegistration,
USER_TYPES,
User,
UserGamertag,
)
-1
View File
@@ -15,7 +15,6 @@ from app.extensions import db
from app.models import Coach, CoachAvailability, PlayerDisponibility, User
from app.routes.users.blueprint import users_bp
DAY_NAMES = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
+2 -1
View File
@@ -119,7 +119,8 @@ def one_on_one():
return redirect(url_for('users.one_on_one'))
# Build list of upcoming dates that have coach availability
from datetime import date as date_cls, timedelta as td
from datetime import date as date_cls
from datetime import timedelta as td
today = date_cls.today()
available_days = {av['day_of_week'] for av in coach_availability}
+3 -3
View File
@@ -8,11 +8,11 @@ from marshmallow import ValidationError
from app.extensions import db, hash_password
from app.logging_config import log_auth_event
from app.models import (
CoachAvailability,
Coach,
Contract,
ESPORT_GAMES,
GAME_PLATFORMS,
Coach,
CoachAvailability,
Contract,
Player,
User,
)