mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-22 03:13:06 +00:00
fix #423
This commit is contained in:
parent
ce032cf8d5
commit
a5205b5126
1 changed files with 4 additions and 1 deletions
|
@ -2664,11 +2664,14 @@ class EvolutionTriggerDetailSerializer(serializers.HyperlinkedModelSerializer):
|
|||
|
||||
evo_objects = PokemonEvolution.objects.filter(evolution_trigger=obj)
|
||||
species_list = []
|
||||
species_names = set()
|
||||
|
||||
for evo in evo_objects:
|
||||
species = PokemonSpeciesSummarySerializer(
|
||||
evo.evolved_species, context=self.context).data
|
||||
species_list.append(species)
|
||||
if species['name'] not in species_names:
|
||||
species_list.append(species)
|
||||
species_names.add(species['name'])
|
||||
|
||||
return species_list
|
||||
|
||||
|
|
Loading…
Reference in a new issue