Ticket #15366: 15366.diff
File 15366.diff, 1.4 KB (added by , 14 years ago) |
---|
-
django/contrib/auth/__init__.py
53 53 for backend in get_backends(): 54 54 try: 55 55 user = backend.authenticate(**credentials) 56 if hasattr(backend,'supports_inactive_user'): 57 user.active_required = not backend.supports_inactive_user 58 else: 59 user.active_required = True 56 60 except TypeError: 57 61 # This backend doesn't accept these credentials as arguments. Try the next one. 58 62 continue -
django/contrib/auth/forms.py
85 85 self.user_cache = authenticate(username=username, password=password) 86 86 if self.user_cache is None: 87 87 raise forms.ValidationError(_("Please enter a correct username and password. Note that both fields are case-sensitive.")) 88 elif not self.user_cache.is_active :88 elif not self.user_cache.is_active and self.user_cache.active_required: 89 89 raise forms.ValidationError(_("This account is inactive.")) 90 90 self.check_for_test_cookie() 91 91 return self.cleaned_data