I'm trying to override (add languages) the messages of form.errors. I've tried this:
forms.py
class CreateUserForm(UserCreationForm):
class Meta:
model = User
fields = ['username', 'email', 'password1', 'password2']
def __init__(self, *args, **kwargs):
super(CreateUserForm, self).__init__(*args, **kwargs)
self.error_messages['duplicate_username'] = 'some message'
After the form is submitted, it's not saved because username are unique and the error is displayed on the template. I'd like to make the same with the password but I can't find out the errors' key for each password validation. Can you provide me it?