From 1fef00ce716cbdab3d4e38193e914354bf3d4fbc Mon Sep 17 00:00:00 2001 From: KwikKill Date: Sat, 2 Mar 2024 18:53:06 +0100 Subject: [PATCH] Deref team captain username --- insalan/tournament/views/tournament.py | 1 + 1 file changed, 1 insertion(+) diff --git a/insalan/tournament/views/tournament.py b/insalan/tournament/views/tournament.py index 60b5c1be..a2dfa68f 100644 --- a/insalan/tournament/views/tournament.py +++ b/insalan/tournament/views/tournament.py @@ -117,6 +117,7 @@ def get(self, request, primary_key: int): "payment_status": Substitute.objects.get(id=pid).payment_status if can_see_payment_status else None } for pid in team_preser["substitutes"] ] + team_preser["captain"] = Player.objects.get(id=team_preser["captain"]).as_user().username if team_preser["captain"] is not None else None teams_serialized.append(team_preser) # deref groups group_serialized = []