authenticate user after their reset confirmation goes through

make password validation code more DRY

grammar nit: "less" -> "fewer"
This commit is contained in:
Adam Palay
2016-06-10 11:21:55 -04:00
parent 5ba8cf8324
commit 95c0b50ebe
6 changed files with 200 additions and 170 deletions

View File

@@ -19,11 +19,7 @@ from django.template import loader
from django.conf import settings
from microsite_configuration import microsite
from student.models import CourseEnrollmentAllowed
from util.password_policy_validators import (
validate_password_length,
validate_password_complexity,
validate_password_dictionary,
)
from util.password_policy_validators import validate_password_strength
from openedx.core.djangoapps.theming import helpers as theming_helpers
@@ -223,9 +219,7 @@ class AccountCreationForm(forms.Form):
raise ValidationError(_("Username and password fields cannot match"))
if self.enforce_password_policy:
try:
validate_password_length(password)
validate_password_complexity(password)
validate_password_dictionary(password)
validate_password_strength(password)
except ValidationError, err:
raise ValidationError(_("Password: ") + "; ".join(err.messages))
return password