Skip to content

Commit

Permalink
fix(backend): Fix setCharacter action
Browse files Browse the repository at this point in the history
  • Loading branch information
barnslig committed Jun 5, 2022
1 parent 6d854b4 commit 44589af
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions backend/dpt_app/trails/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def serialize_code(code: Code, game: Game):
actions.append(
{
"type": "setCharacter",
"character": action.character,
"character": action.character.character_class,
}
)
elif action.action_type == ActionType.MESSAGE and game.hasMessages:
Expand Down Expand Up @@ -304,10 +304,7 @@ def post_code(request: HttpRequest, gameId: str, codeId: str):
pass
elif action.action_type == ActionType.CHARACTER:
try:
character = Character.objects.get(
character_class=action.character
)
request.player.character = character
request.player.character = action.character
request.player.save()
except:
pass
Expand Down

0 comments on commit 44589af

Please sign in to comment.