Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import UNUSABLE_PASSWORD with Django 1.6.2 #6

Open
ghost opened this issue Mar 11, 2014 · 1 comment
Open

Cannot import UNUSABLE_PASSWORD with Django 1.6.2 #6

ghost opened this issue Mar 11, 2014 · 1 comment
Labels

Comments

@ghost
Copy link

ghost commented Mar 11, 2014

Hi, after upgrading to Django 1.6.2, registration-me produced an error:

ImportError at /accounts/login

cannot import UNUSABLE_PASSWORD

A solution was to change registration/forms.py and replace

from django.contrib.auth.hashers import UNUSABLE_PASSWORD

with
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX

And change in PasswordResetForm:

if self.users_cache.filter(password=UNUSABLE_PASSWORD).count():

to

if self.users_cache.filter(password__startswith=UNUSABLE_PASSWORD_PREFIX).count():

I wonder if this is a good solution?

@lig lig added the bug label Mar 11, 2014
@lig
Copy link
Owner

lig commented Mar 11, 2014

Looks like it could be acceptable. Thank you for your suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant