Commit 27fe80d5 by Carlos Andrés Rocha

[34078525] Use system random to generate passwords

parent 87967b9e
...@@ -66,7 +66,8 @@ def default_render_failure(request, ...@@ -66,7 +66,8 @@ def default_render_failure(request,
def generate_password(length=12, chars=string.letters + string.digits): def generate_password(length=12, chars=string.letters + string.digits):
"""Generate internal password for externally authenticated user""" """Generate internal password for externally authenticated user"""
return ''.join([random.choice(chars) for i in range(length)]) choice = random.SystemRandom().choice
return ''.join([choice(chars) for i in range(length)])
@csrf_exempt @csrf_exempt
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment