From f83ba70acff1402ef606e3531b63a0e6744e66f9 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Sun, 11 Apr 2021 19:27:47 +0200 Subject: [PATCH] =?UTF-8?q?On=20r=C3=A9cup=C3=A8re=20mieux=20l'adresse=20d?= =?UTF-8?q?e=20l'=C3=A9lection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- elections/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/elections/utils.py b/elections/utils.py index 5b0ec03..9e04a87 100644 --- a/elections/utils.py +++ b/elections/utils.py @@ -11,6 +11,7 @@ from django.core.exceptions import ValidationError from django.core.mail import EmailMessage, get_connection from django.core.validators import validate_email from django.template.loader import render_to_string +from django.urls import reverse from django.utils.translation import gettext_lazy as _ # ############################################################################# @@ -348,7 +349,8 @@ def send_mail(election, mail_form): from .models import User voters = list(election.registered_voters.all()) - url = f"https://kadenios.eleves.ens.fr/elections/view/{election.id}" + e_url = reverse("election.view", args=[election.id]) + url = f"https://vote.eleves.ens.fr/{e_url}" messages = [] for v in voters: password = generate_password()