Skip to content

Commit 01b59d6

Browse files
committed
Remove unused code
1 parent fdf5482 commit 01b59d6

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

authtools/forms.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,18 @@
11
from __future__ import unicode_literals
22

3-
from django import forms, VERSION
3+
from django import forms
44
from django.contrib.auth.forms import (
55
ReadOnlyPasswordHashWidget,
66
PasswordResetForm as OldPasswordResetForm,
77
UserChangeForm as DjangoUserChangeForm,
88
AuthenticationForm as DjangoAuthenticationForm,
99
)
1010
from django.contrib.auth import get_user_model, password_validation
11-
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX
1211
from django.utils.translation import gettext_lazy as _
1312

1413
User = get_user_model()
1514

1615

17-
def is_password_usable(pw):
18-
"""Decide whether a password is usable only by the unusable password prefix.
19-
20-
We can't use django.contrib.auth.hashers.is_password_usable either, because
21-
it not only checks against the unusable password, but checks for a valid
22-
hasher too. We need different error messages in those cases.
23-
"""
24-
25-
return not pw.startswith(UNUSABLE_PASSWORD_PREFIX)
26-
27-
2816
class BetterReadOnlyPasswordHashWidget(ReadOnlyPasswordHashWidget):
2917
"""
3018
A ReadOnlyPasswordHashWidget that has a less intimidating output.

0 commit comments

Comments
 (0)