X-Git-Url: https://git.mdrn.pl/cas.git/blobdiff_plain/37e278e43ece42375352c07d9f04991ef58d992c..213ac837c03049f290b7f0035659641f9fa3411a:/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