Skip to content

Commit 0fb7226

Browse files
committed
fixup! 修复了密码组件(PasswordInputField)上存在的渲染异常.
Signed-off-by: Sadam·Sadik <1903249375@qq.com>
1 parent a36c3c4 commit 0fb7226

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

simplepro/components/widgets/input_password.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class PasswordInputWidget(forms.CharField, Input):
2323
template_name = "admin/components/input_password.html"
2424

2525
def __init__(self,
26-
input_type='text',
2726
max_length=48, min_length=6, placeholder=None, clearable=True,
2827
show_password=False,
2928
show_word_limit=False,
@@ -35,7 +34,7 @@ def __init__(self,
3534
*args, **kwargs):
3635
super(PasswordInputWidget, self).__init__(*args)
3736
self.items = {
38-
'type': input_type,
37+
'type': 'password',
3938
'placeholder': placeholder,
4039
':clearable': clearable,
4140
':show-password': show_password,
@@ -85,7 +84,7 @@ def render(self, name, value, attrs=None, renderer=None):
8584
'lenMin': self.min_length,
8685
'lenMax': self.max_length,
8786
'pwdPattern': self.pattern,
88-
'encrypt': self.encrypt
87+
'encrypt': force_text(self.encrypt)
8988
},
9089
}
9190
_str = render_to_string(self.template_name, ctx)

0 commit comments

Comments
 (0)