Ticket #5605: 5605_new.patch
File 5605_new.patch, 2.5 KB (added by , 15 years ago) |
---|
-
django/contrib/auth/models.py
105 105 def create_user(self, username, email, password=None): 106 106 "Creates and saves a User with the given username, e-mail and password." 107 107 now = datetime.datetime.now() 108 user = self.model(None, username, '', '', email.strip().lower(), 'placeholder', False, True, False, now, now) 108 # Make only the domain lowercase. 109 parts = email.strip().split('@', 1) 110 if len(parts) > 1: 111 parts[1] = parts[1].lower() 112 email = '@'.join(parts) 113 user = self.model(None, username, '', '', email, 'placeholder', False, True, False, now, now) 109 114 if password: 110 115 user.set_password(password) 111 116 else: -
django/contrib/auth/tests/forms.py
219 219 >>> form.cleaned_data['email'] 220 220 u'jsmith3@example.com' 221 221 222 # bug #5605, preserve the case of the user name (before the @ in the email address) 223 # when creating a user. 224 >>> user = User.objects.create_user('test2', 'tesT@EXAMple.com', 'test') 225 >>> user.email 226 'tesT@example.com' 227 >>> user = User.objects.create_user('test3', 'tesT', 'test') 228 >>> user.email 229 'tesT' 230 222 231 """ -
docs/topics/auth.txt
291 291 292 292 Creates, saves and returns a :class:`~django.contrib.auth.models.User`. 293 293 The :attr:`~django.contrib.auth.models.User.username`, 294 :attr:`~django.contrib.auth.models.User.email` and 295 :attr:`~django.contrib.auth.models.User.password` are set as given, and the 296 :class:`~django.contrib.auth.models.User` gets ``is_active=True``. 297 294 :attr:`~django.contrib.auth.models.User.password` are set as given, 295 the domain portion of :attr:`~django.contrib.auth.models.User.email` 296 gets lowercased, and the :class:`~django.contrib.auth.models.User` gets 297 ``is_active=True``. 298 298 299 If no password is provided, 299 300 :meth:`~django.contrib.auth.models.User.set_unusable_password()` will 300 301 be called.