8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-25 22:22:26 +00:00

Correctly send a confirmation email

This commit is contained in:
Jean-Romain Garnier 2020-04-17 19:11:24 +00:00 committed by Supelec Rezo Rennes
parent 10243e1e72
commit 00b62e1fdc
2 changed files with 3 additions and 3 deletions

View file

@ -810,15 +810,15 @@ class User(
self.email_state = self.EMAIL_STATE_PENDING self.email_state = self.EMAIL_STATE_PENDING
# Fully archived users shouldn't get an email # Fully archived users shouldn't get an email
if self.state != self.STATE_FULL_ARCHIVE: if self.state == self.STATE_FULL_ARCHIVE:
return False return False
# Always keep the oldest change date # Always keep the oldest change date
if self.email_change_date is None: if self.email_change_date is None:
self.email_change_date = timezone.now() self.email_change_date = timezone.now()
self.save()
self.confirm_email_address_mail(request) self.confirm_email_address_mail(request)
return True return True
def confirm_email_before_date(self): def confirm_email_before_date(self):

View file

@ -1069,7 +1069,7 @@ def resend_confirmation_email(request, logged_user, userid):
messages.error(request, _("The user doesn't exist.")) messages.error(request, _("The user doesn't exist."))
if request.method == "POST": 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.")) messages.success(request, _("An email to confirm your address was sent."))
return redirect(reverse("users:profil", kwargs={"userid": userid})) return redirect(reverse("users:profil", kwargs={"userid": userid}))