Closed xusy2k closed 9 years ago
Can you provide the whole stack trace?
Environment:
Request Method: GET Request URL: http://localhost:8000/admin/
Django Version: 1.5.12 Python Version: 2.7.6 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', 'django.contrib.admindocs', 'password_policies') Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'password_policies.middleware.PasswordChangeMiddleware')
Traceback: File "/home/xus/.virtualenvs/test_django/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
Exception Type: KeyError at /admin/ Exception Value: '_password_policies_change_required'
Thx! Can you try to remove the 'password_policies.middleware.PasswordChangeMiddleware'. Won't work anyway if you set PASSWORD_USE_HISTORY to false I think...
The middleware is not very reliable and needs to be rewritten.
Is there a reason why you need the middleware and disable the usage of the password history at the same time?
Thx! It worked! Only reason for need the middleware and disable the usage of the password history is for testing PASSWORD_CHECK_ONLY_AT_LOGIN = False feature, but I don't want to use historic passwords. Finally I set PASSWORD_HISTORY_COUNT = 1
So this issue could be closed?
Yes!, It worked for me
Closing as it seems to work for @xusy2k.
If I set PASSWORD_USE_HISTORY to False I always get this exception