From: Guillaume Subiron Date: Fri, 8 Jun 2012 07:41:44 +0000 (+0200) Subject: Continue arg in login and logout routes X-Git-Url: https://git.cyclocoop.org/Special:BookSources/%7B%7B%20url_for%28%27static%27%2C%20filename=%27js/%40%20%27entree_adresse_email%27%20=%3E%20%27Your%20email%20address%27%2C%20%27entree_adresse_email_2%27%20=%3E%20%27E-mail%20address%27%2C%20%27entree_base_donnee_1%27%20=%3E%20%27Database%20address%27%2C-%27entree_base_donnee_2%27%20=%3E%20%27%28This%20address%20is%20often%20your%20site/%27s%20URL%2C%20although%20sometimes%20it%20will%20be?a=commitdiff_plain;h=3c19321cfaca486ce5a3b7c68a58e9c1dfceefa2;p=cavote.git Continue arg in login and logout routes --- 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 %}