diff --git a/battleship/views.py b/battleship/views.py index 63fbee0..01699f3 100644 --- a/battleship/views.py +++ b/battleship/views.py @@ -147,7 +147,8 @@ def get_fields(request): another_field = player2.field game_finished = 'o' not in player.field or 'o' not in player2.field if not game_finished: - another_field = list(another_field.replace('o', ' ')) + another_field = another_field.replace('o', ' ') + another_field = list(another_field) return JsonResponse({ 'my_field': [my_field[x * 10: (x + 1) * 10] for x in range(0, 10)], 'opponent_field': [another_field[x * 10: (x + 1) * 10] for x in range(0, 10)],