Ticket #12103: 12103.diff
File 12103.diff, 1.1 KB (added by , 15 years ago) |
---|
-
django/contrib/auth/forms.py
59 59 username = forms.CharField(label=_("Username"), max_length=30) 60 60 password = forms.CharField(label=_("Password"), widget=forms.PasswordInput) 61 61 62 allow_inactive_logins = False 63 62 64 def __init__(self, request=None, *args, **kwargs): 63 65 """ 64 66 If request is passed in, the form will validate that cookies are … … 78 80 self.user_cache = authenticate(username=username, password=password) 79 81 if self.user_cache is None: 80 82 raise forms.ValidationError(_("Please enter a correct username and password. Note that both fields are case-sensitive.")) 81 elif not self. user_cache.is_active:83 elif not self.allow_inactive_logins and not self.user_cache.is_active: 82 84 raise forms.ValidationError(_("This account is inactive.")) 83 85 84 86 # TODO: determine whether this should move to its own method.