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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user