Skip to content
Snippets Groups Projects
Commit e51fae37 authored by Feanil Patel's avatar Feanil Patel
Browse files

letters doesn't exist in python 3.6

Use `ascii_letters` instead which is a reasonable alternative for our
usecases.
parent 4d1a320f
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ import logging
import os
from collections import OrderedDict
from random import choice
from string import digits, letters, punctuation
from string import digits, ascii_letters, punctuation
from uuid import uuid4
import openid.oidutil
......@@ -292,7 +292,7 @@ FEATURES['ENABLE_PAYMENT_FAKE'] = True
# the same settings, we can generate this randomly and guarantee
# that they are using the same secret.
RANDOM_SHARED_SECRET = ''.join(
choice(letters + digits + punctuation)
choice(ascii_letters + digits + punctuation)
for x in range(250)
)
......
......@@ -180,7 +180,7 @@ def retrieve_last_sitewide_block_completed(user):
)
def generate_password(length=12, chars=string.letters + string.digits):
def generate_password(length=12, chars=string.ascii_letters + string.digits):
"""Generate a valid random password"""
if length < 8:
raise ValueError("password must be at least 8 characters")
......
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