From 6e12bf223fe32ab1584da91806e8ff144804cf11 Mon Sep 17 00:00:00 2001 From: Miguel Date: Thu, 27 Jul 2023 21:04:15 -0500 Subject: [PATCH] feat: change logic on chain-evolution endpoint --- pokemon_v2/serializers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 260978489..9c72bff13 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -3376,7 +3376,9 @@ def build_chain(self, obj): chain_id = obj.id pokemon_objects = PokemonSpecies.objects.filter( - evolution_chain_id=chain_id + evolution_chain_id=PokemonSpecies.objects.get( + id=chain_id + ).evolution_chain_id ).order_by("order") summary_data = PokemonSpeciesSummarySerializer( pokemon_objects, many=True, context=self.context