From ba294b4c31badf2cbc8fe8c251fbd21dacdfc343 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Thu, 19 Dec 2019 19:19:18 +0100 Subject: [PATCH 1/2] Sign-in by email: Send email to address in database --- course/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/course/auth.py b/course/auth.py index 4e97b0c0..6fc79a33 100644 --- a/course/auth.py +++ b/course/auth.py @@ -807,7 +807,7 @@ def sign_in_by_email(request): message, getattr(settings, "NO_REPLY_EMAIL_FROM", settings.ROBOT_EMAIL_FROM), - [email]) + [user.email]) from relate.utils import get_outbound_mail_connection msg.connection = ( -- GitLab From 40c872bcc56d937775e14233ab6e8bb01f3edf0d Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Thu, 19 Dec 2019 19:19:38 +0100 Subject: [PATCH 2/2] Sign-in-by-email: Only mark user unconfirmed if just created --- course/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/course/auth.py b/course/auth.py index 6fc79a33..62c7f3ef 100644 --- a/course/auth.py +++ b/course/auth.py @@ -786,8 +786,8 @@ def sign_in_by_email(request): if created: user.set_unusable_password() + user.status = user_status.unconfirmed - user.status = user_status.unconfirmed, user.sign_in_key = make_sign_in_key(user) user.save() -- GitLab