From 1e27541d2c5f17b4436f7cf0926c00b84b3786fc Mon Sep 17 00:00:00 2001 From: Ava Date: Wed, 10 Sep 2025 14:25:54 -0400 Subject: [PATCH] Fixes issue with server returning 502s due to attempting to return players not in current game (too many) --- hvzsite/hvz/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hvzsite/hvz/views.py b/hvzsite/hvz/views.py index e743375..a7ca994 100644 --- a/hvzsite/hvz/views.py +++ b/hvzsite/hvz/views.py @@ -426,15 +426,16 @@ class ApiPlayers(APIView): Returns all player information ''' def get(self, request): + game = get_active_game() players = [ { 'name': p.readable_name(request.user.is_authenticated and request.user.active_this_game), 'id': p.player_uuid, 'status': p.current_status.get_status_display(), 'tags': p.current_status.num_tags, - } for p in Person.objects.all() + } for p in Person.full_name_objects.filter(playerstatus__game=game, playerstatus__status__in=['h','v','e','z','o','x','a','m']) ] - + data = { 'players': players }