mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-22 03:13:06 +00:00
making simonorono's suggest changes
This commit is contained in:
parent
5e37282c2f
commit
99f2131424
1 changed files with 6 additions and 6 deletions
|
@ -2343,12 +2343,12 @@ class MoveDetailSerializer(serializers.ModelSerializer):
|
||||||
data = MoveEffectEffectTextSerializer(
|
data = MoveEffectEffectTextSerializer(
|
||||||
effect_texts, many=True, context=self.context
|
effect_texts, many=True, context=self.context
|
||||||
).data
|
).data
|
||||||
effect_entries = data[0]
|
if len(data) > 0:
|
||||||
for _i, k in enumerate(effect_entries):
|
for key, value in data[0].items():
|
||||||
if "$effect_chance%" in effect_entries[k]:
|
if "$effect_chance%" in value:
|
||||||
data[0][k] = effect_entries[k].replace(
|
data[0][key] = value.replace(
|
||||||
"$effect_chance", f"{obj.move_effect_chance}"
|
"$effect_chance", f"{obj.move_effect_chance}"
|
||||||
)
|
)
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue