Django forms Fehler anpassen
class AccountForm(forms.Form):
email = forms.EmailField(max_length=255)
username = forms.CharField(max_length=40)
password = PasswordField(label="Password")
password_confirm = PasswordField(label="Password")
def clean(self):
cd = self.cleaned_data
if cd.get('password') != cd.get('password_confirm'):
self.add_error('password_confirm', "passwords do not match !")
return cd
Bored Bison