From dcb54d871d31af42a04926a9e57f9aa65f4776bd Mon Sep 17 00:00:00 2001 From: Nina Menezes Date: Tue, 13 Aug 2024 16:40:00 +0100 Subject: [PATCH] Lower case emails --- consultation_analyser/consultations/views/sessions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consultation_analyser/consultations/views/sessions.py b/consultation_analyser/consultations/views/sessions.py index 1b556d0f..222e7c61 100644 --- a/consultation_analyser/consultations/views/sessions.py +++ b/consultation_analyser/consultations/views/sessions.py @@ -14,6 +14,7 @@ def send_magic_link_if_email_exists(request: HttpRequest, email: str) -> None: try: + email = email.lower() user = User.objects.get(email=email) link = MagicLink.objects.create(user=user, redirect_to="/") magic_link = request.build_absolute_uri(link.get_absolute_url()) @@ -36,7 +37,6 @@ def new(request: HttpRequest): form = NewSessionForm(request.POST) if form.is_valid(): email = form.cleaned_data["email"] - email = email.lower() send_magic_link_if_email_exists(request, email) return render(request, "magic_link/link_sent.html")