Removing help_text from Django UserCreateForm

后端 未结 7 1294
感动是毒
感动是毒 2020-12-05 14:10

Probably a poor question, but I\'m using Django\'s UserCreationForm (slightly modified to include email), and I would like to remove the help_text that Django automatically

7条回答
  •  难免孤独
    2020-12-05 14:28

    Just go to UserCreationForm and make the required changes.

    very simple hold control button on your keyboard and ckick on UserCreationForm you will get the UserCreationForm make the required changes as per your need and save it. as i did it for me in the below example i commented the Help Content.

      error_messages = {
        'password_mismatch': _("The two password fields didn't match."),
    }
    password1 = forms.CharField(
        label=_("Password"),
        strip=False,
        widget=forms.PasswordInput,
        # help_text=password_validation.password_validators_help_text_html(),
    )
    password2 = forms.CharField(
        label=_("Password confirmation"),
        widget=forms.PasswordInput,
        strip=False,
        help_text=_("Enter the same password as before, for verification."),
    )
    

提交回复
热议问题