tarak / django-password-policies

Django unicode-aware password policies.
Other
59 stars 92 forks source link

Made PasswordResetForm compatible with Django 1.6 #16

Closed jakenbuhler closed 10 years ago

jakenbuhler commented 10 years ago

Django 1.6 changed the way unusable passwords work. Part of this included the removal of the UNUSABLE_PASSWORD variable. This was handled by importing UNUSABLE_PASSWORD_PREFIX when UNUSABLE_PASSWORD was unavailable. The problem is that PasswordResetForm's clean_email method still contains a reference to UNUSABLE_PASSWORD, which would be undefined when using Django 1.6, leading to a NameError on form validation.

My solution uses the is_password_usable function, which is defined in both Django 1.5 and 1.6 (and earlier). I've written tests to verify that PasswordResetForm correctly handles usable and unusable passwords.

tarak commented 10 years ago

thx!