From 663457d4bc10b5561840060510a505a6d9437d10 Mon Sep 17 00:00:00 2001 From: Stefan Rupp Date: Tue, 7 Apr 2020 21:13:23 +0200 Subject: [PATCH] implement redirections for now --- views/control.py | 3 +-- views/player.py | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/views/control.py b/views/control.py index b719007..32e4c1e 100644 --- a/views/control.py +++ b/views/control.py @@ -13,5 +13,4 @@ def index(req, resp): @api.route("/control/deal/{cards}") def deal(req, resp, cards): the_game.deal_cards(int(cards)) - resp.content = api.template('home/control.html', deck=the_game.card_deck, - trump_card=the_game.trump_card, trump_color=the_game.get_trump_color()) + api.redirect(resp, '/control/', status_code=303) diff --git a/views/player.py b/views/player.py index bd68776..ee1b824 100644 --- a/views/player.py +++ b/views/player.py @@ -19,9 +19,6 @@ def play(req, resp, player: str, card: str): pl = the_game.players[p] c = pl.play_card(int(card)) the_game.table.play_card(p, c) - tcard = the_game.trump_card - tcolor = the_game.get_trump_color() - table = the_game.table - resp.content = api.template('home/player.html', player=player, cards=the_game.players[p].cards, - trump_card=tcard, trump_color=tcolor, played_cards=table.played_cards) + url = '/player/'+player + api.redirect(resp, url, status_code=303)