Control password field duplication
Currently password is copied automatically in all the fields. If application author does not want user to enter password two times, he may forbid field cloning with 'confirm_input' option. Targets blueprint: update-password-field Change-Id: I6d5544e61d76af96a5dc10cec48bc994c83add76
This commit is contained in:
parent
6ce981df78
commit
4f2f120f15
|
@ -237,6 +237,7 @@ class PasswordField(CharField):
|
|||
js = ('muranodashboard/js/passwordfield.js',)
|
||||
|
||||
def __init__(self, label, *args, **kwargs):
|
||||
self.confirm_input = kwargs.pop('confirm_input', True)
|
||||
help_text = kwargs.get('help_text')
|
||||
if not help_text:
|
||||
help_text = _('Enter a complex password with at least one letter, \
|
||||
|
|
|
@ -162,8 +162,8 @@ class UpdatableFieldsForm(forms.Form):
|
|||
|
||||
for name, field in six.iteritems(self.fields):
|
||||
updated_fields[name] = field
|
||||
if (isinstance(field, fields.PasswordField) and
|
||||
not field.has_clone and field.original):
|
||||
if isinstance(field, fields.PasswordField) and field.confirm_input:
|
||||
if not field.has_clone and field.original:
|
||||
updated_fields[
|
||||
field.get_clone_name(name)] = field.clone_field()
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
|
||||
features:
|
||||
- Dynamic UI field of type *password* supports ``confirmInput`` parameter
|
||||
now. It controls whethere password field should be cloned or not.
|
||||
If application author decided to turn off automatic field cloning, he
|
||||
should set the new parameter to *false*.
|
||||
|
Loading…
Reference in New Issue