From db620e9c90149b0aca3814c7703419003ad00aa0 Mon Sep 17 00:00:00 2001 From: Jean-Romain Garnier Date: Fri, 17 Apr 2020 20:50:26 +0200 Subject: [PATCH] Always send confirmation email, except for fully-archived users --- users/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/users/models.py b/users/models.py index b9162f5b..d1d8c86a 100755 --- a/users/models.py +++ b/users/models.py @@ -807,15 +807,16 @@ class User( if self.__original_email == self.email: return False - # Archived users shouldn't get an email - if self.state not in [self.STATE_ACTIVE, self.STATE_DISABLED, self.STATE_NOT_YET_ACTIVE]: + self.email_state = self.EMAIL_STATE_PENDING + + # Fully archived users shouldn't get an email + 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.email_state = self.EMAIL_STATE_PENDING self.confirm_email_address_mail(request) return True