如何编辑UserCreationForm密码帮助文本? [英] How to edit UserCreationForm password help text?

查看:76
本文介绍了如何编辑UserCreationForm密码帮助文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我创建一个继承自 UserCreationForm 的注册表单时,文本您的密码不能与您的其他个人信息太相似。您的密码必须至少包含8个字符。您的密码不能是常用密码。您的密码不能完全是数字。出现在密码输入字段下,并占用相当多的空间。我有办法删除吗?

When I create a registration form that inherits from UserCreationForm, the text "Your password can't be too similar to your other personal information. Your password must contain at least 8 characters. Your password can't be a commonly used password. Your password can't be entirely numeric." appears under the password input fields and takes up quite a bit of space. Is there a way I can remove this?

我知道用户名帮助文本可以通过以下方式删除:

I know the username help text can be removed with:

 help_texts = {
        'username': None
    }

但是

help_texts = {
        'password1': None,
        'password2': None,
    }

推荐答案

  password1 = forms.CharField(
            label='Password', widget=forms.PasswordInput())
        password2 = forms.CharField(
            label='Confirm Password(again)', widget=forms.PasswordInput())

这篇关于如何编辑UserCreationForm密码帮助文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆