Password check in sane place.

This commit is contained in:
nikolark committed 2011-10-17 02:27:54 +02:00
1 parent 2bdaf32e87
commit 63243efd4c
2 files changed
+9 -5

No files matched your search

+9
View File
@@ -1,4 +1,6 @@
from django.contrib.auth.forms import SetPasswordForm
from django.core.validators import MinLengthValidator
from validators import PasswordValidator
from models import *
@@ -13,6 +15,13 @@ class LDAPSetPasswordForm(SetPasswordForm):
self.user.save()
return self.user
def clean_new_password1(self):
raw_password = self.cleaned_data.get('new_password1')
# Validation here?
MinLengthValidator(8)(raw_password)
PasswordValidator(raw_passwords)
return raw_password
class LDAPPasswordChangeForm(LDAPSetPasswordForm):
pass
#old_password = forms.CharField(label=_("Old password"), widget=forms.PasswordInput)