X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=main.py;h=4ccd46c1203d6780595268e20daebbf3fe8e0c83;hb=3884468d1f06525285de49e5cee744d6ea482ae7;hp=956e438727ff40728c8a4e69278057d242fce453;hpb=3c19321cfaca486ce5a3b7c68a58e9c1dfceefa2;p=cavote.git diff --git a/main.py b/main.py index 956e438..4ccd46c 100755 --- a/main.py +++ b/main.py @@ -124,7 +124,7 @@ def password_lost(): "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.", @@ -254,7 +254,7 @@ def admin_user_add(): "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'], @@ -478,6 +478,11 @@ def vote(idvote): vote['percent'] = int((float(vote['nb_votes']) / float(vote['max_votes'])) * 100) if query_db('select * from user_group where id_group = ? and id_user = ?', [vote['id_group'], get_userid()], one=True) and not vote['is_terminated']: flash(u'Ce vote vous concerne !', 'info') + publisher = query_db("select name from users where id = ?", [vote['id_author']], one=True) + if publisher is None: + vote['author'] = "NDN" + else: + vote['author'] = publisher['name'] return render_template('vote.html', vote=vote, attachments=attachments, choices=choices, users=users.values(), can_vote=can_vote(idvote, get_userid())) flash(u'Vous n\'avez pas le droit de voir ce vote, désolé.') return redirect(url_for('home'))