I'm taking advantage of these built-in Django forms and I am running into a small issue.
- class AdminPasswordChangeForm
- class AuthenticationForm
- class PasswordChangeForm
- class PasswordResetForm
- class SetPasswordForm
- class UserChangeForm
- class UserCreationForm
For example, the UserCreationForm generates several validation errors which I can display in the my template using tags such as {{ form.errors }} or even ones related to a specific field such as {{ form.username.errors }}.
I know how to customize the styling of these error messages, but how can I customize the text? I have been able to simply check if an error exists with a conditional statement such as {% if form.password.errors %} and place my own custom text in that block. However, that leaves me blind to the type of error that was raised.
For instance, I want to be able to identify if the triggered error was a duplicate_username or a password_mismatch so I can write my own error in the template.
Any help would be appreciated!