1 from django import forms
2 from django.contrib.auth.models import User as DjangoUser
3 from django.utils.translation import ugettext_lazy as _
5 class UserBasicForm(forms.ModelForm):
9 fields = ('first_name', 'last_name', 'email',)
12 class UserPasswordForm(forms.Form):
14 new_password = forms.CharField(widget=forms.PasswordInput(),
15 label=_("Your new password"))
16 verifier = forms.CharField(widget=forms.PasswordInput(),
17 label=_("Repeated password"))
20 if 'verifier' not in self.cleaned_data or 'new_password' not in self.cleaned_data:
21 return self.cleaned_data
23 if self.cleaned_data['verifier'] != self.cleaned_data['new_password']:
24 raise forms.ValidationError(_("Passwords do not match!"))
26 return self.cleaned_data