letters doesn't exist in python 3.6

Use `ascii_letters` instead which is a reasonable alternative for our
usecases.
This commit is contained in:
Feanil Patel
2019-07-17 15:40:54 -04:00
parent 4d1a320fa0
commit e51fae3784
2 changed files with 3 additions and 3 deletions

View File

@@ -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)
)

View File

@@ -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")