password: make sure generated password use an integer length (#39885)

This commit is contained in:
Frédéric Péters 2020-02-14 13:59:51 +01:00
parent f5089e9788
commit 3792591af2
1 changed files with 1 additions and 0 deletions

View File

@ -82,6 +82,7 @@ def make_password(min_len=None, max_len=None):
length = min(max_len, 6)
else:
length = 6
length = int(length)
r = random.SystemRandom()
return ''.join([r.choice('abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ2345678923456789') for x in range(length)])