Ticket #5761: 5761.diff

File 5761.diff, 758 bytes (added by Matt Boersma, 17 years ago)

Similar patch against django trunk as of [6534].

  • django/contrib/auth/models.py

     
    120120        "Generates a random password with the given length and given allowed_chars"
    121121        # Note that default value of allowed_chars does not have "I" or letters
    122122        # that look like it -- just to avoid confusion.
    123         from random import choice
    124         return ''.join([choice(allowed_chars) for i in range(length)])
     123        from random import sample
     124        return ''.join(sample(allowed_chars, length))
    125125
    126126class User(models.Model):
    127127    """Users within the Django authentication system are represented by this model.
Back to Top