This commit is contained in:
Kronopt 2019-05-01 03:42:24 +01:00 committed by Charles Marttinen
parent ce032cf8d5
commit a5205b5126

View file

@ -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