Ticket #5761: 5761.diff
File 5761.diff, 758 bytes (added by , 17 years ago) |
---|
-
django/contrib/auth/models.py
120 120 "Generates a random password with the given length and given allowed_chars" 121 121 # Note that default value of allowed_chars does not have "I" or letters 122 122 # that look like it -- just to avoid confusion. 123 from random import choice124 return ''.join( [choice(allowed_chars) for i in range(length)])123 from random import sample 124 return ''.join(sample(allowed_chars, length)) 125 125 126 126 class User(models.Model): 127 127 """Users within the Django authentication system are represented by this model.