+# TODO: Remove these automated forms and use html templates and views like any other page !
+from django.contrib.auth.hashers import identify_hasher
+# adapted from https://sourcegraph.com/github.com/fusionbox/django-authtools/symbols/python/authtools/forms
+
+def is_password_unusable(pw):
+ # like Django's is_password_usable, but only checks for unusable
+ # passwords, not invalidly encoded passwords too.
+ try:
+ # 1.5
+ from django.contrib.auth.hashers import UNUSABLE_PASSWORD
+ return pw == UNUSABLE_PASSWORD
+ except ImportError:
+ # 1.6
+ from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX
+ return pw.startswith(UNUSABLE_PASSWORD_PREFIX)
+