Merge "Control password field duplication"

This commit is contained in:
Jenkins 2016-01-15 01:56:47 +00:00 committed by Gerrit Code Review
commit 1103077917
3 changed files with 13 additions and 4 deletions

View File

@ -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, \

View File

@ -175,10 +175,10 @@ 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):
updated_fields[
field.get_clone_name(name)] = field.clone_field()
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()
self.fields = updated_fields

View File

@ -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*.