mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-22 11:23:13 +00:00
Merge pull request #1031 from SKCwillie/issue1024
Updating MoveDetailSerializer to change $effect_chance to actual number
This commit is contained in:
commit
b5d617a52f
1 changed files with 6 additions and 0 deletions
|
@ -2343,6 +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
|
||||||
|
if len(data) > 0:
|
||||||
|
for key, value in data[0].items():
|
||||||
|
if "$effect_chance%" in value:
|
||||||
|
data[0][key] = value.replace(
|
||||||
|
"$effect_chance", f"{obj.move_effect_chance}"
|
||||||
|
)
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue