19 |
19 |
from django.core.urlresolvers import reverse
|
20 |
20 |
from django.core.validators import RegexValidator
|
21 |
21 |
|
22 |
|
from authentic2.forms.fields import NewPasswordField, CheckPasswordField
|
|
22 |
from authentic2.forms.fields import PasswordField, NewPasswordField, CheckPasswordField
|
23 |
23 |
from .. import app_settings, compat, forms, utils, validators, models, middleware, hooks
|
24 |
24 |
from authentic2.a2_rbac.models import OrganizationalUnit
|
25 |
25 |
|
... | ... | |
164 |
164 |
|
165 |
165 |
|
166 |
166 |
class SetPasswordForm(NotifyOfPasswordChange, PasswordResetMixin, auth_forms.SetPasswordForm):
|
167 |
|
new_password1 = CharField(label=_("New password"),
|
168 |
|
widget=PasswordInput,
|
169 |
|
validators=[validators.validate_password],
|
170 |
|
help_text=validators.password_help_text())
|
|
167 |
new_password1 = NewPasswordField(label=_("New password"))
|
|
168 |
new_password2 = CheckPasswordField(label=_("New password confirmation"))
|
171 |
169 |
|
172 |
170 |
def clean_new_password1(self):
|
173 |
171 |
new_password1 = self.cleaned_data.get('new_password1')
|
... | ... | |
178 |
176 |
|
179 |
177 |
class PasswordChangeForm(NotifyOfPasswordChange, forms.NextUrlFormMixin, PasswordResetMixin,
|
180 |
178 |
auth_forms.PasswordChangeForm):
|
181 |
|
new_password1 = CharField(label=_("New password"),
|
182 |
|
widget=PasswordInput,
|
183 |
|
validators=[validators.validate_password],
|
184 |
|
help_text=validators.password_help_text())
|
|
179 |
old_password = PasswordField(label=_('Old password'))
|
|
180 |
new_password1 = NewPasswordField(label=_('New password'))
|
|
181 |
new_password2 = CheckPasswordField(label=_("New password confirmation"))
|
185 |
182 |
|
186 |
183 |
def clean_new_password1(self):
|
187 |
184 |
new_password1 = self.cleaned_data.get('new_password1')
|
188 |
|
-
|