From 3c19321cfaca486ce5a3b7c68a58e9c1dfceefa2 Mon Sep 17 00:00:00 2001 From: Guillaume Subiron Date: Fri, 8 Jun 2012 09:41:44 +0200 Subject: [PATCH] Continue arg in login and logout routes --- main.py | 4 ++++ templates/layout.html | 4 ++-- templates/login.html | 2 +- templates/votes.html | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 6b391c3..956e438 100755 --- a/main.py +++ b/main.py @@ -92,6 +92,8 @@ def login(): else: connect_user(user) flash(u'Vous êtes connecté. Bienvenue, %s !' % user['name'], 'success') + if request.args.get('continue'): + return redirect(request.args['continue']) return redirect(url_for('home')) return render_template('login.html') @@ -99,6 +101,8 @@ def login(): def logout(): disconnect_user() flash(u'Vous avez été déconnecté.', 'info') + if request.args.get('continue') and not "admin" in request.args.get('continue'): + return redirect(request.args['continue']) return redirect(url_for('home')) #----------------- diff --git a/templates/layout.html b/templates/layout.html index 6fe38aa..fff1187 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -44,10 +44,10 @@
  • Votes en attente
  • Paramètres
  • -
  • Déconnexion
  • +
  • Déconnexion
  • {% else %} - Connexion + Connexion {% endif %} diff --git a/templates/login.html b/templates/login.html index 332195e..b00dc72 100644 --- a/templates/login.html +++ b/templates/login.html @@ -2,7 +2,7 @@ {% block body %}
    -
    +
    Connexion diff --git a/templates/votes.html b/templates/votes.html index 0cb1b51..616e3b3 100644 --- a/templates/votes.html +++ b/templates/votes.html @@ -31,7 +31,7 @@ Liste des votes {% if vote.description %}

    Description

    - {{ vote.description|safe }} + {{ vote.description }}

    {% endif %}
    -- 2.20.1