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')
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'))
#-----------------
"From: %s" % EMAIL,
"To: %s" % user['email'],
"Subject: [Cavote] Password lost",
- "Date: %s" % time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()),
+ "Date: %s" % time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()).decode('utf-8'),
"X-Mailer: %s" % VERSION,
"",
"You have lost your password.",
"From: %s" % EMAIL,
"To: %s" % user['email'],
"Subject: [Cavote] Welcome",
- "Date: %s" % time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()),
+ "Date: %s" % time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()).decode('utf-8'),
"X-Mailer: %s" % VERSION,
"",
"Hi %s!" % user['name'],
@app.route('/vote/<idvote>', methods=['GET', 'POST'])
def vote(idvote):
- vote = query_db('select votes.*, groups.name as groupname from votes join groups on groups.id=votes.id_group where votes.id=?', [idvote], one=True)
+ vote = query_db('select votes.*, groups.name as groupname, users.name as author from votes join groups on groups.id=votes.id_group join users on users.id = id_author where votes.id=?', [idvote], one=True)
if vote is None:
abort(404)
if can_see_vote(idvote, get_userid()):