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()