X-Git-Url: https://git.mdrn.pl/cas.git/blobdiff_plain/37e278e43ece42375352c07d9f04991ef58d992c..efd1292d83f2371cba42a41a9480963acd5dd5bc:/src/accounts/forms.py diff --git a/src/accounts/forms.py b/src/accounts/forms.py index 5dcb842..0c8cb66 100644 --- a/src/accounts/forms.py +++ b/src/accounts/forms.py @@ -1,26 +1,10 @@ from django import forms -from django.contrib.auth.models import User as DjangoUser -from django.utils.translation import ugettext_lazy as _ +from django.contrib.auth.models import User + class UserBasicForm(forms.ModelForm): class Meta: - model = DjangoUser + model = User fields = ('first_name', 'last_name', 'email',) - -class UserPasswordForm(forms.Form): - - new_password = forms.CharField(widget=forms.PasswordInput(), - label=_("Your new password")) - verifier = forms.CharField(widget=forms.PasswordInput(), - label=_("Repeated password")) - - def clean(self): - if 'verifier' not in self.cleaned_data or 'new_password' not in self.cleaned_data: - return self.cleaned_data - - if self.cleaned_data['verifier'] != self.cleaned_data['new_password']: - raise forms.ValidationError(_("Passwords do not match!")) - - return self.cleaned_data