diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-08-08 15:52:15 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-08-08 15:52:15 +0200 |
commit | a23a15a3e16d430a193c00268168690b61a7d2e4 (patch) | |
tree | 8be9336fdc59c62bc704f7a28f7de8df10249732 | |
parent | d912e47b70a4348cebd22695b9e847531e76705a (diff) | |
download | Ishtar-a23a15a3e16d430a193c00268168690b61a7d2e4.tar.bz2 Ishtar-a23a15a3e16d430a193c00268168690b61a7d2e4.zip |
Account form: help message regarding new passwords
-rw-r--r-- | ishtar_common/forms_common.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 4c7fb32aa..93e1839f0 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -44,7 +44,7 @@ from ishtar_common.templatetags.link_to_window import simple_link_to_window from .forms import FinalForm, FormSet, reverse_lazy, name_validator, \ TableSelect, ManageOldType, CustomForm, FieldType, FormHeader, \ FormSetWithDeleteSwitches, BSForm, get_data_from_formset, \ - file_size_validator, HistorySelect, CustomFormSearch, QAForm + file_size_validator, HistorySelect, CustomFormSearch, QAForm, IshtarForm from ishtar_common.utils import is_downloadable, clean_session_cache, \ max_size_help @@ -758,7 +758,7 @@ class PersonTypeForm(ManageOldType, forms.Form): self.fields['person_type'].help_text = models.PersonType.get_help() -class AccountForm(forms.Form): +class AccountForm(IshtarForm): form_label = _("Account") associated_models = {'pk': models.Person} currents = {'pk': models.Person} @@ -774,6 +774,15 @@ class AccountForm(forms.Form): label=_(u"New password (confirmation)"), max_length=128, widget=forms.PasswordInput, required=False) + HEADERS = { + 'hidden_password': FormHeader( + _(u"New password"), + help_message=_("Keep theses fields empty if you do not want to " + "change password. On creation, if you leave these " + "fields empty, the user will not be able to " + "connect.")), + } + def __init__(self, *args, **kwargs): person = None if 'initial' in kwargs and 'pk' in kwargs['initial']: |