This commit is contained in:
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user