From 9f1c6a57e27630de12cc0ea7010ae013ec46c768 Mon Sep 17 00:00:00 2001 From: Jean-Romain Garnier Date: Fri, 17 Apr 2020 19:11:24 +0000 Subject: [PATCH] Correctly send a confirmation email --- users/models.py | 4 ++-- users/views.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/users/models.py b/users/models.py index c9730167..2c71c466 100755 --- a/users/models.py +++ b/users/models.py @@ -810,15 +810,15 @@ class User( self.email_state = self.EMAIL_STATE_PENDING # Fully archived users shouldn't get an email - if self.state != self.STATE_FULL_ARCHIVE: + if self.state == self.STATE_FULL_ARCHIVE: return False # Always keep the oldest change date if self.email_change_date is None: self.email_change_date = timezone.now() + self.save() self.confirm_email_address_mail(request) - return True def confirm_email_before_date(self): diff --git a/users/views.py b/users/views.py index 4b539b9d..551fd350 100644 --- a/users/views.py +++ b/users/views.py @@ -1069,7 +1069,7 @@ def resend_confirmation_email(request, logged_user, userid): messages.error(request, _("The user doesn't exist.")) if request.method == "POST": - user.send_confirm_email_if_necessary(request) + user.confirm_email_address_mail(request) messages.success(request, _("An email to confirm your address was sent.")) return redirect(reverse("users:profil", kwargs={"userid": userid}))