From b7021f32cb71016df2a43651589fd53eeff36b79 Mon Sep 17 00:00:00 2001 From: Jean-Romain Garnier Date: Fri, 17 Apr 2020 12:50:22 +0200 Subject: [PATCH] Automatically consider email valid when user is set to STATE_ACTIVE --- users/models.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/users/models.py b/users/models.py index 467056e7..7f2481cb 100755 --- a/users/models.py +++ b/users/models.py @@ -654,16 +654,15 @@ class User( and self.state == self.STATE_FULL_ARCHIVE ): self.full_archive() - elif ( - self.__original_state == self.STATE_EMAIL_NOT_YET_CONFIRMED - and self.state not in [self.STATE_EMAIL_NOT_YET_CONFIRMED, self.STATE_DISABLED] - ): - self.email_change_date = None elif ( self.__original_state != self.STATE_EMAIL_NOT_YET_CONFIRMED and self.state == self.STATE_EMAIL_NOT_YET_CONFIRMED ): self.email_change_date = timezone.now() + elif ( + self.state == self.STATE_ACTIVE + ): + self.email_change_date = None def ldap_sync( self, base=True, access_refresh=True, mac_refresh=True, group_refresh=False