Skip to content

Commit

Permalink
Merge pull request #1031 from SKCwillie/issue1024
Browse files Browse the repository at this point in the history
Updating MoveDetailSerializer to change $effect_chance to actual number
  • Loading branch information
Naramsim committed Feb 19, 2024
2 parents e4e2cd6 + 567e6a1 commit b5d617a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pokemon_v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2343,6 +2343,12 @@ def get_effect_text(self, obj):
data = MoveEffectEffectTextSerializer(
effect_texts, many=True, context=self.context
).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

Expand Down

0 comments on commit b5d617a

Please sign in to comment.