8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-25 22:22:26 +00:00

Fix error preventing migration

This commit is contained in:
Jean-Romain Garnier 2020-04-17 18:01:35 +02:00 committed by Gabriel Detraz
parent 19b463bc1e
commit 2a068a7e0a

View file

@ -405,7 +405,6 @@ class AdherentCreationForm(AdherentForm):
AdherentForm auquel on ajoute une checkbox afin d'éviter les
doublons d'utilisateurs et, optionnellement,
un champ mot de passe"""
if OptionalUser.get_cached_value("allow_set_password_during_user_creation"):
# Champ pour choisir si un lien est envoyé par mail pour le mot de passe
init_password_by_mail_info = _(
"If this options is set, you will receive a link to set"
@ -481,6 +480,12 @@ class AdherentCreationForm(AdherentForm):
)
)
# Remove password fields if option is disabled
if not OptionalUser.get_cached_value("allow_set_password_during_user_creation"):
self.fields.pop("init_password_by_mail")
self.fields.pop("password1")
self.fields.pop("password2")
def clean_password1(self):
"""Ignore ce champs si la case init_password_by_mail est décochée"""
send_email = self.cleaned_data.get("init_password_by_mail")