8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-16 00:13:12 +00:00

Automatically consider email valid when user is set to STATE_ACTIVE

This commit is contained in:
Jean-Romain Garnier 2020-04-17 12:50:22 +02:00 committed by Gabriel Detraz
parent d4f13f8832
commit b7021f32cb

View file

@ -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