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

Don't set User.email_change_date to None

This commit is contained in:
Jean-Romain Garnier 2020-04-17 22:54:27 +02:00 committed by Gabriel Detraz
parent def91bff7a
commit 1c65dc50ff

View file

@ -812,8 +812,8 @@ class User(
if self.state == self.STATE_FULL_ARCHIVE: if self.state == self.STATE_FULL_ARCHIVE:
return False return False
# Always keep the oldest change date # Don't allow users without a confirmed email to postpone their due date
if self.email_change_date is None: if self.state == self.STATE_ACTIVE or not self.email_change_date:
self.email_change_date = timezone.now() self.email_change_date = timezone.now()
self.save() self.save()
@ -821,7 +821,7 @@ class User(
return True return True
def confirm_email_before_date(self): def confirm_email_before_date(self):
if self.email_change_date is None or self.email_state == self.EMAIL_STATE_VERIFIED: if self.email_state == self.EMAIL_STATE_VERIFIED:
return None return None
days = OptionalUser.get_cached_value("disable_emailnotyetconfirmed") days = OptionalUser.get_cached_value("disable_emailnotyetconfirmed")
@ -946,8 +946,6 @@ class User(
def confirm_mail(self): def confirm_mail(self):
"""Marque l'email de l'utilisateur comme confirmé""" """Marque l'email de l'utilisateur comme confirmé"""
# Reset the email change date and update the email status
self.email_change_date = None
self.email_state = self.EMAIL_STATE_VERIFIED self.email_state = self.EMAIL_STATE_VERIFIED
@cached_property @cached_property