Skip to content
Snippets Groups Projects
Commit 27fe80d5 authored by Carlos Andrés Rocha's avatar Carlos Andrés Rocha
Browse files

[34078525] Use system random to generate passwords

parent 87967b9e
No related branches found
No related tags found
No related merge requests found
......@@ -66,7 +66,8 @@ def default_render_failure(request,
def generate_password(length=12, chars=string.letters + string.digits):
"""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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment