8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 07:23:46 +00:00

Set email_change_date on user creation

This commit is contained in:
Jean-Romain Garnier 2020-04-17 18:29:22 +02:00 committed by Jean-Romain Garnier
parent 91c031f287
commit 30667eb259

View file

@ -518,6 +518,7 @@ class AdherentCreationForm(AdherentForm):
an email to init the password should be sent"""
# Save the provided password in hashed format
user = super(AdherentForm, self).save(commit=False)
user.email_change_date = timezone.now()
is_set_password_allowed = OptionalUser.get_cached_value("allow_set_password_during_user_creation")
send_email = not is_set_password_allowed or self.cleaned_data.get("init_password_by_mail")