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