On récupère mieux l'adresse de l'élection

This commit is contained in:
Tom Hubrecht 2021-04-11 19:27:47 +02:00
parent 77c9880cf4
commit f83ba70acf

View file

@ -11,6 +11,7 @@ from django.core.exceptions import ValidationError
from django.core.mail import EmailMessage, get_connection from django.core.mail import EmailMessage, get_connection
from django.core.validators import validate_email from django.core.validators import validate_email
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
# ############################################################################# # #############################################################################
@ -348,7 +349,8 @@ def send_mail(election, mail_form):
from .models import User from .models import User
voters = list(election.registered_voters.all()) 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 = [] messages = []
for v in voters: for v in voters:
password = generate_password() password = generate_password()