Ticket #15366: 15366-alternative.diff
File 15366-alternative.diff, 973 bytes (added by , 13 years ago) |
---|
-
django/contrib/auth/forms.py
127 127 "enabled. Cookies are required for logging in."), 128 128 'inactive': _("This account is inactive."), 129 129 } 130 allow_inactive_user = False 130 131 131 132 def __init__(self, request=None, *args, **kwargs): 132 133 """ … … 147 148 self.user_cache = authenticate(username=username, password=password) 148 149 if self.user_cache is None: 149 150 raise forms.ValidationError(self.error_messages['invalid_login']) 150 elif not self. user_cache.is_active:151 elif not self.allow_inactive_user and not self.user_cache.is_active: 151 152 raise forms.ValidationError(self.error_messages['inactive']) 152 153 self.check_for_test_cookie() 153 154 return self.cleaned_data