Ajout du joueur responsable
CI - Security, Lint & Tests / validate (push) Canceled after 0s

This commit is contained in:
cedrick2711
2026-09-27 14:25:29 -04:00
parent bd9ed4bdc7
commit 2e5903b131
18 changed files with 795 additions and 14 deletions
+9 -2
View File
@@ -61,7 +61,14 @@ class OrgTeam(db.Model):
return [tp.player for tp in self.team_players]
def get_players_with_status(self):
return [
{'player': tp.player, 'status': tp.status, 'position': tp.position}
rows = [
{
'player': tp.player,
'status': tp.status,
'position': tp.position,
'is_team_representative': tp.is_team_representative,
}
for tp in self.team_players
]
# The responsible heads the roster; everyone else keeps roster order.
return sorted(rows, key=lambda row: not row['is_team_representative'])
+4
View File
@@ -12,6 +12,10 @@ class TeamPlayer(db.Model):
player_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False)
org_team_id = db.Column(db.Integer, db.ForeignKey('org_teams.id'), nullable=False)
status = db.Column(db.String(20), nullable=False, default='starter')
#: A player an admin named as their team's responsible ("joueur
#: responsable") — see app/permissions.py. Grants match-management
#: rights for that one team and nothing else.
is_team_representative = db.Column(db.Boolean, nullable=False, default=False)
position = db.Column(db.String(50), nullable=True)
added_at = db.Column(db.DateTime, default=utc_now_naive)