X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=main.py;h=dc2259d2e736f4837c0a2110d8ca14439c78c475;hb=4e40699a612e494d4d740d69b18d34aa40749789;hp=3fcc5aea3660da2c9192fa374b51c2cb3531650b;hpb=9a0814e7bcf5aba1289f4bcbf09043a69dd03c5a;p=cavote.git diff --git a/main.py b/main.py index 3fcc5ae..dc2259d 100755 --- a/main.py +++ b/main.py @@ -135,7 +135,7 @@ def password_lost(): link, "", "If you think this mail is not for you, please ignore and delete it." - ), "\n") + ), "\r\n") server = smtplib.SMTP(SMTP_SERVER) server.sendmail(EMAIL, [user['email']], BODY) server.quit() @@ -264,7 +264,7 @@ def admin_user_add(): "To log in for the first time and set your password, please follow this link :", link, "" - ), "\n") + ), "\r\n") server = smtplib.SMTP(SMTP_SERVER) server.sendmail(EMAIL, [user['email']], BODY) server.quit() @@ -381,7 +381,7 @@ def votes(votes): basequery = 'select votes.*, max_votes from votes left join (' + max_votes + ') as max_votes on votes.id_group = max_votes.id_group' nb_votes = 'select id_vote, count(*) as nb_votes from (select id_user, id_vote from user_choice join choices on id_choice = choices.id group by id_user, id_vote) group by id_vote' basequery = 'select * from (' + basequery + ') left join (' + nb_votes + ') on id = id_vote' - basequery = 'select *, votes.id as voteid, groups.name as groupname from (' + basequery + ') as votes join groups on groups.id = id_group where is_open=1' + basequery = 'select *, votes.id as voteid, groups.name as groupname, users.name as author from (' + basequery + ') as votes join groups on groups.id = id_group join users on users.id = id_author where is_open=1' if votes == 'all': votes = query_db(basequery + ' order by date_end') elif votes == 'archive':