Ticket #14674: 14674.patch
File 14674.patch, 1.9 KB (added by , 14 years ago) |
---|
-
django/contrib/auth/forms.py
1 from django.contrib.auth.models import User 1 from django.contrib.auth.models import User, UNUSABLE_PASSWORD 2 2 from django.contrib.auth import authenticate 3 3 from django.contrib.auth.tokens import default_token_generator 4 4 from django.contrib.sites.models import get_current_site … … 111 111 Validates that a user exists with the given e-mail address. 112 112 """ 113 113 email = self.cleaned_data["email"] 114 self.users_cache = User.objects.filter(email__iexact=email) 114 self.users_cache = User.objects.filter(email__iexact=email).exclude( 115 password=UNUSABLE_PASSWORD) 115 116 if len(self.users_cache) == 0: 116 117 raise forms.ValidationError(_("That e-mail address doesn't have an associated user account. Are you sure you've registered?")) 117 118 return email -
docs/topics/auth.txt
202 202 You may need this if authentication for your application takes place 203 203 against an existing external source such as an LDAP directory. 204 204 205 Also, users with unusable_password will not able to request reseting 206 their passwords 207 205 208 .. method:: models.User.has_usable_password() 206 209 207 210 .. versionadded:: 1.0 … … 916 919 that can be used to reset the password, and sending that link to the 917 920 user's registered e-mail address. 918 921 922 Reseting password will not work for users with unusable_password, 923 see :meth:`~django.contrib.auth.models.User.set_unusable_password()` 924 919 925 **Optional arguments:** 920 926 921 927 * ``template_name``: The full name of a template to use for