mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 11:23:10 +00:00
Fix error preventing migration
This commit is contained in:
parent
1484b6ec1e
commit
3c5e538218
1 changed files with 38 additions and 33 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue