fix utf-8 issue and a missing variable in reminder.py
authorJulien Rabier <taziden@flexiden.org>
Sat, 25 May 2013 23:28:26 +0000 (01:28 +0200)
committerJulien Rabier <taziden@flexiden.org>
Sat, 25 May 2013 23:28:26 +0000 (01:28 +0200)
reminder.py

index ff75f99..6be8643 100644 (file)
@@ -45,7 +45,7 @@ for vote in c.execute('select id, id_group, date_end, title from votes where is_
                     "Content-type: text/plain; charset=utf-8",
                     "X-Mailer: %s" % VERSION,
                     "",
                     "Content-type: text/plain; charset=utf-8",
                     "X-Mailer: %s" % VERSION,
                     "",
-                    "%s %s : %s" % (gettext(u"A vote concerns you and is going to terminate on"), vote[2].encode('utf-8'), vote[3].encode('utf-8')),
+                    "%s %s : %s" % (gettext(u"A vote concerns you and is going to terminate on"), vote[2], vote[3]),
                     gettext(u"You still didn't take part to it !"),
                     "",
                     gettext(u"This link will bring you to the form where you will be able to participate :"),
                     gettext(u"You still didn't take part to it !"),
                     "",
                     gettext(u"This link will bring you to the form where you will be able to participate :"),
@@ -60,6 +60,7 @@ for vote in c.execute('select id, id_group, date_end, title from votes where is_
                 server.sendmail(EMAIL, user[1], BODY.encode('utf-8'))
                 server.quit()
             else:
                 server.sendmail(EMAIL, user[1], BODY.encode('utf-8'))
                 server.quit()
             else:
+                link = "http://vote.ffdn.org/vote/%d" % vote[0]
                 BODY = string.join((
                     "From: %s" % EMAIL,
                     "To: %s" % user[1],
                 BODY = string.join((
                     "From: %s" % EMAIL,
                     "To: %s" % user[1],
@@ -68,7 +69,7 @@ for vote in c.execute('select id, id_group, date_end, title from votes where is_
                     "Content-type: text/plain; charset=utf-8",
                     "X-Mailer: %s" % VERSION,
                     "",
                     "Content-type: text/plain; charset=utf-8",
                     "X-Mailer: %s" % VERSION,
                     "",
-                    "%s %s : %s" % (gettext(u"A vote concerns you and is going to terminate on "), vote[2].encode('utf-8'), vote[3].encode('utf-8')),
+                    "%s %s : %s" % (gettext(u"A vote concerns you and is going to terminate on "), vote[2], vote[3]),
                     gettext(u"You have already voted but you can still modify your choice"),
                     "",
                     gettext(u"This link will bring you to the form where you will be able to participate :"),
                     gettext(u"You have already voted but you can still modify your choice"),
                     "",
                     gettext(u"This link will bring you to the form where you will be able to participate :"),