8
0
Fork 0
mirror of https://gitlab.federez.net/re2o/re2o synced 2024-05-20 17:42:26 +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 Gabriel Detraz
parent 73b11a3e93
commit d8cfb2e3d5

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")